--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+
+/* $Id$ */
+
+//---
+// Produces the data needed to calculate the quality assurance.
+// All data must be mergeable objects.
+// A. Mastroserio
+//---
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TH1F.h>
+#include <TH2F.h>
+#include <TH1I.h>
+#include <TDirectory.h>
+#include <Riostream.h>
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliESDCaloCluster.h"
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliHMPIDDigit.h"
+#include "AliHMPIDHit.h"
+#include "AliHMPIDCluster.h"
+#include "AliHMPIDQADataMakerRec.h"
+
+ClassImp(AliHMPIDQADataMakerRec)
+
+//____________________________________________________________________________
+ AliHMPIDQADataMakerRec::AliHMPIDQADataMakerRec() :
+ AliQADataMakerRec(AliQA::GetDetName(AliQA::kHMPID), "HMPID Quality Assurance Data Maker"),
+// fhHitQdc(0x0),
+// fhSDigits(0x0),
+// fhDigPcEvt(0x0),
+// fhDigChEvt(0x0),
+// fhDigQ(0x0),
+// fhCluEvt(0x0),
+// fhCluChi2(0x0),
+// fhCluQ(0x0),
+ fhCluFlg(0x0),
+ fhCluSize(0x0),
+ fhMipCluSize(0x0),
+ fhCkovP(0x0),
+ fhSigP(0x0),
+ fhMipXY(0x0),
+ fhDifXY(0x0)
+{
+ // ctor
+// for(Int_t i=0; i<7; i++) fhHitMap[i]=0x0;
+ for(Int_t j=0; j<5; j++) fhPid[j]=0x0;
+// fDetectorDir = fOutput->GetDirectory(GetName()) ;
+// if (!fDetectorDir)
+// fDetectorDir = fOutput->mkdir(GetName()) ;
+}
+
+//____________________________________________________________________________
+AliHMPIDQADataMakerRec::AliHMPIDQADataMakerRec(const AliHMPIDQADataMakerRec& qadm) :
+ AliQADataMakerRec(),
+ // fhHitQdc(qadm.fhHitQdc),
+// fhSDigits(qadm.fhSDigits),
+// fhDigPcEvt(qadm.fhDigPcEvt),
+// fhDigChEvt(qadm.fhDigChEvt),
+// fhDigQ(qadm.fhDigQ),
+ fhCluEvt(qadm.fhCluEvt),
+ fhCluChi2(qadm.fhCluChi2),
+ fhCluQ(qadm.fhCluQ),
+ fhCluFlg(qadm.fhCluFlg),
+ fhCluSize(qadm.fhCluSize),
+ fhMipCluSize(qadm.fhMipCluSize),
+ fhCkovP(qadm.fhCkovP),
+ fhSigP(qadm.fhSigP),
+ fhMipXY(qadm.fhMipXY),
+ fhDifXY(qadm.fhDifXY)
+{
+ //copy ctor
+// for(Int_t i=0; i<7; i++) fhHitMap[i]=qadm.fhHitMap[i];
+ for(Int_t j=0; j<5; j++) fhPid[j]=qadm.fhPid[j];
+
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliHMPIDQADataMakerRec& AliHMPIDQADataMakerRec::operator = (const AliHMPIDQADataMakerRec& qadm )
+{
+ // Equal operator.
+ this->~AliHMPIDQADataMakerRec();
+ new(this) AliHMPIDQADataMakerRec(qadm);
+ return *this;
+}
+
+//____________________________________________________________________________
+
+void AliHMPIDQADataMakerRec::InitRecPoints()
+{
+ // create cluster histograms in RecPoint subdir
+ fhCluEvt=new TH1F("CluPerEvt","# clusters per chamber",16,-1,7);
+ fhCluChi2 =new TH1F("CluChi2" ,"Chi2 " ,1000,0,100);
+ fhCluQ =new TH1F("CluQ" ,"Cluster charge" ,3000,0,3000);
+ fhCluFlg =new TH1F("CluFlg" ,"Cluster flag" ,14,-1.5,12.5);
+ fhCluSize =new TH1F("CluSize" ,"Raw cluster size ",100,0,100);
+ fhMipCluSize =new TH1F("MipCluSize" ,"Mip cluster size ",100,0,100);
+}
+//____________________________________________________________________________
+void AliHMPIDQADataMakerRec::InitESDs()
+{
+ //create ESDs histograms in ESDs subdir
+ fhCkovP = new TH2F("CkovP" , "#theta_{c}, [rad];P, [GeV]" , 150, 0, 7 ,100, 0, 1) ;
+ fhSigP = new TH2F("SigP" ,"#sigma_{#theta_c} [mrad];[GeV]", 150, 0, 7 ,100, 0, 1) ;
+ fhMipXY = new TH2F("MipXY" ,"mip position" , 260, 0,130 ,252, 0,126) ;
+ fhDifXY = new TH2F("DifXY" ,"diff" , 200, -10, 10 ,200,-10,10) ;
+ fhPid[0] = new TH1F("PidE" ,"PID: e yellow #mu magenta" ,100,0,1) ;
+ fhPid[1] = new TH1F("PidMu","pid of #mu" ,100,0,1) ;
+ fhPid[2] = new TH1F("PidPi","PID: #pi red K green p blue",100,0,1) ;
+ fhPid[3] = new TH1F("PidK" ,"pid of K" ,100,0,1) ;
+ fhPid[4] = new TH1F("PidP" ,"pid of p" ,100,0,1) ;
+}
+
+//____________________________________________________________________________
+void AliHMPIDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
+{
+ //fills QA histos for clusters
+
+ TClonesArray *clusters = new TClonesArray("AliHMPIDCluster");
+ for(int i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++){
+ TBranch *branch = clustersTree->GetBranch(Form("HMPID%d",i));
+ branch->SetAddress(&clusters);
+ branch->GetEntry(0);
+
+ fhCluEvt->Fill(i,clusters->GetEntries());
+ TIter next(clusters);
+ AliHMPIDCluster *clu;
+ while ( (clu = dynamic_cast<AliHMPIDCluster *>(next())) ) {;
+ fhCluFlg->Fill(clu->Status()); fhCluChi2->Fill(clu->Chi2()); fhCluSize->Fill(clu->Size());
+ fhCluQ->Fill(clu->Q());
+ Int_t qCut=100;
+ if(clu->Q()>qCut) {
+ fhMipCluSize->SetTitle(Form("Mip cluster size at a Qcut = %i ADC",qCut));
+ fhMipCluSize->Fill(clu->Size());
+ }
+ }
+ }
+
+ clusters->Delete();
+ delete clusters;
+}
+
+//____________________________________________________________________________
+void AliHMPIDQADataMakerRec::MakeESDs(AliESDEvent * esd)
+{
+ //fills QA histos for ESD
+ for(Int_t iTrk = 0 ; iTrk < esd->GetNumberOfTracks() ; iTrk++){
+ AliESDtrack *pTrk = esd->GetTrack(iTrk) ;
+ fhCkovP->Fill(pTrk->GetP(),pTrk->GetHMPIDsignal());
+ fhSigP->Fill( pTrk->GetP(),TMath::Sqrt(pTrk->GetHMPIDchi2()));
+ Float_t xm,ym; Int_t q,np;
+ pTrk->GetHMPIDmip(xm,ym,q,np); //mip info
+ fhMipXY->Fill(xm,ym);
+ Float_t xRad,yRad,th,ph;
+ pTrk->GetHMPIDtrk(xRad,yRad,th,ph); //track info at the middle of the radiator
+ Float_t xPc = xRad+9.25*TMath::Tan(th)*TMath::Cos(ph); // temporar: linear extrapol (B=0!)
+ Float_t yPc = yRad+9.25*TMath::Tan(th)*TMath::Sin(ph); // temporar: "
+ fhDifXY->Fill(xm-xPc,ym-yPc); //track info
+ Double_t pid[5] ; pTrk->GetHMPIDpid(pid) ;
+ for(Int_t i = 0 ; i < 5 ; i++) fhPid[i]->Fill(pid[i]) ;
+ }
+}
+
--- /dev/null
+#ifndef AliHMPIDQADataMakerRec_H
+#define AliHMPIDQADataMakerRec_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+//
+// Produces the data needed to calculate the quality assurance.
+// All data must be mergeable objects.
+// A. Mastroserio
+
+
+
+// --- ROOT system ---
+
+
+class TH1F ;
+class TH2F ;
+class TH1I ;
+
+// --- Standard library ---
+#include <TString.h>
+// --- AliRoot header files ---
+
+#include "AliQADataMakerRec.h"
+
+class AliHMPIDQADataMakerRec: public AliQADataMakerRec {
+
+public:
+ AliHMPIDQADataMakerRec() ; // ctor
+ AliHMPIDQADataMakerRec(const AliHMPIDQADataMakerRec& qadm) ;
+ AliHMPIDQADataMakerRec& operator = (const AliHMPIDQADataMakerRec& qadm) ;
+ virtual ~AliHMPIDQADataMakerRec() {;} // dtor
+
+private:
+ virtual void InitRecPoints(); //book cluster QA histo
+ virtual void InitESDs() ; //book ESD QA histo
+ virtual void MakeRecPoints(TTree * clusters) ; //Fill cluster QA histo
+ virtual void MakeESDs(AliESDEvent * esd) ; //Fill hit QA histo
+
+// TH1F *fhHitQdc; // Hit Q distr
+// TH2F *fhHitMap[7]; // Hit Q positions
+// TH1F *fhSDigits ; // SDigit Q distr
+// TH1F *fhDigPcEvt; // Pc occupancy per event
+// TH1F *fhDigChEvt; // Chamber occupancy per event
+// TH1F *fhDigQ; // Digit Q distr
+
+ TH1F *fhCluEvt; // N clusters per chamber
+ TH1F *fhCluChi2; // Chi2
+ TH1F *fhCluQ; // cluster Q distr
+ TH1F *fhCluFlg; // resolved cluster flag
+ TH1F *fhCluSize; // raw cluster size
+ TH1F *fhMipCluSize; // mip cluster size
+
+ TH2F *fhCkovP; // thetaC vs P
+ TH2F *fhSigP; // sigmaC vs P
+ TH2F *fhMipXY; // mip position on PC
+ TH2F *fhDifXY; // mip(X,Y) - extrapolated track(X,Y)
+ TH1F *fhPid[5]; // Pid responses
+
+ ClassDef(AliHMPIDQADataMakerRec,1) // description
+
+};
+
+#endif // AliHMPIDQADataMakerRec_H
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+
+/* $Id$ */
+
+//---
+// Produces the data needed to calculate the quality assurance.
+// All data must be mergeable objects.
+// A. Mastroserio
+//---
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TH1F.h>
+#include <TH2F.h>
+#include <TH1I.h>
+#include <TDirectory.h>
+#include <Riostream.h>
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliLog.h"
+#include "AliHMPIDDigit.h"
+#include "AliHMPIDHit.h"
+#include "AliHMPIDQADataMakerSim.h"
+
+ClassImp(AliHMPIDQADataMakerSim)
+
+//____________________________________________________________________________
+ AliHMPIDQADataMakerSim::AliHMPIDQADataMakerSim() :
+ AliQADataMakerSim(AliQA::GetDetName(AliQA::kHMPID), "HMPID Quality Assurance Data Maker"),
+ fhHitQdc(0x0),
+ fhSDigits(0x0),
+ fhDigPcEvt(0x0),
+ fhDigChEvt(0x0),
+ fhDigQ(0x0)
+ // fhCluEvt(0x0),
+// fhCluChi2(0x0),
+// fhCluQ(0x0),
+// fhCluFlg(0x0),
+// fhCluSize(0x0),
+// fhMipCluSize(0x0),
+// fhCkovP(0x0),
+// fhSigP(0x0),
+// fhMipXY(0x0),
+// fhDifXY(0x0)
+{
+ // ctor
+ for(Int_t i=0; i<7; i++) fhHitMap[i]=0x0;
+// for(Int_t j=0; j<5; j++) fhPid[j]=0x0;
+// fDetectorDir = fOutput->GetDirectory(GetName()) ;
+// if (!fDetectorDir)
+// fDetectorDir = fOutput->mkdir(GetName()) ;
+}
+
+//____________________________________________________________________________
+AliHMPIDQADataMakerSim::AliHMPIDQADataMakerSim(const AliHMPIDQADataMakerSim& qadm) :
+ AliQADataMakerSim(),
+ fhHitQdc(qadm.fhHitQdc),
+ fhSDigits(qadm.fhSDigits),
+ fhDigPcEvt(qadm.fhDigPcEvt),
+ fhDigChEvt(qadm.fhDigChEvt),
+ fhDigQ(qadm.fhDigQ)
+// fhCluEvt(qadm.fhCluEvt),
+// fhCluChi2(qadm.fhCluChi2),
+// fhCluQ(qadm.fhCluQ),
+// fhCluFlg(qadm.fhCluFlg),
+// fhCluSize(qadm.fhCluSize),
+// fhMipCluSize(qadm.fhMipCluSize),
+// fhCkovP(qadm.fhCkovP),
+// fhSigP(qadm.fhSigP),
+// fhMipXY(qadm.fhMipXY),
+// fhDifXY(qadm.fhDifXY)
+{
+ //copy ctor
+ for(Int_t i=0; i<7; i++) fhHitMap[i]=qadm.fhHitMap[i];
+// for(Int_t j=0; j<5; j++) fhPid[j]=qadm.fhPid[j];
+
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliHMPIDQADataMakerSim& AliHMPIDQADataMakerSim::operator = (const AliHMPIDQADataMakerSim& qadm )
+{
+ // Equal operator.
+ this->~AliHMPIDQADataMakerSim();
+ new(this) AliHMPIDQADataMakerSim(qadm);
+ return *this;
+}
+
+//____________________________________________________________________________
+void AliHMPIDQADataMakerSim::InitHits()
+{
+ // create Hits histograms in Hits subdir
+ fhHitQdc=new TH1F("HitQdc","HMPID Hit Qdc all chamber;QDC",500,0,4000);
+ for(Int_t iCh=0;iCh<7;iCh++)
+ fhHitMap[iCh]=new TH2F(Form("HMPID HitMap%i",iCh),Form("Ch%i;x_{Hit};y_{Hit}",iCh),162,-1,161,146,-1,145);
+}
+
+//____________________________________________________________________________
+void AliHMPIDQADataMakerSim::InitDigits()
+{
+ // create Digits histograms in Digits subdir
+ fhDigPcEvt=new TH1F("hDigPcEvt","PC occupancy",156,-1,77);
+ fhDigChEvt=new TH1F("hDigChEvt","Chamber occupancy",32,-1,7);
+ fhDigQ =new TH1F("Q "," digit charge ",3000,0,3000);
+}
+
+//____________________________________________________________________________
+void AliHMPIDQADataMakerSim::InitSDigits()
+{
+ // create SDigits histograms in SDigits subdir
+ fhSDigits = new TH1F("hHmpidSDigits", "SDigits Q distribution in HMPID", 500, 0., 5000.) ;
+}
+
+//____________________________________________________________________________
+void AliHMPIDQADataMakerSim::MakeHits(TObject * data)
+{
+ //fills QA histos for Hits
+ TClonesArray * hits = dynamic_cast<TClonesArray *>(data) ;
+ if (!hits){
+ AliError("Wrong type of hits container") ;
+ } else {
+ TIter next(hits);
+ AliHMPIDHit * hit ;
+ while ( (hit = dynamic_cast<AliHMPIDHit *>(next())) ) {
+ if(hit->Pid()<500000) fhHitQdc->Fill(hit->Q()) ;
+ if(hit->Pid()<500000) fhHitMap[hit->Ch()]->Fill(hit->LorsX(),hit->LorsY());
+ }
+ }
+}
+
+//____________________________________________________________________________
+void AliHMPIDQADataMakerSim::MakeDigits( TObject * data)
+{
+ //fills QA histos for Digits
+ TObjArray *chambers = dynamic_cast<TObjArray*>(data);
+ if ( !chambers) {
+ AliError("Wrong type of digits container") ;
+ } else {
+ for(Int_t i =0; i< chambers->GetEntries(); i++)
+ {
+ TClonesArray * digits = dynamic_cast<TClonesArray*>(chambers->At(i));
+ fhDigChEvt->Fill(i,digits->GetEntriesFast()/(48.*80.*6.));
+ TIter next(digits);
+ AliHMPIDDigit * digit;
+ while ( (digit = dynamic_cast<AliHMPIDDigit *>(next())) ) {
+ fhDigPcEvt->Fill(10.*i+digit->Pc(),1./(48.*80.));
+ fhDigQ->Fill(digit->Q());
+ }
+ }
+ }
+}
+
+//____________________________________________________________________________
+void AliHMPIDQADataMakerSim::MakeSDigits( TObject * data)
+{
+ //fills QA histos for SDigits
+ TClonesArray * sdigits = dynamic_cast<TClonesArray *>(data) ;
+ if (!sdigits) {
+ AliError("Wrong type of sdigits container") ;
+ } else {
+ AliHMPIDDigit *ref = (AliHMPIDDigit *)sdigits->At(0);
+ Float_t zero = ref->GetTrack(0);
+ TIter next(sdigits) ;
+ AliHMPIDDigit * sdigit ;
+ while ( (sdigit = dynamic_cast<AliHMPIDDigit *>(next())) ) {
+ fhSDigits->Fill(sdigit->Q()) ;
+ if(zero == sdigit->GetTrack(0)) continue;
+ else zero = sdigit->GetTrack(0);
+ }
+ }
+}
--- /dev/null
+#ifndef AliHMPIDQADataMakerSim_H
+#define AliHMPIDQADataMakerSim_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+//
+// Produces the data needed to calculate the quality assurance.
+// All data must be mergeable objects.
+// A. Mastroserio
+
+
+
+// --- ROOT system ---
+
+
+class TH1F ;
+class TH2F ;
+class TH1I ;
+
+// --- Standard library ---
+#include <TString.h>
+// --- AliRoot header files ---
+
+#include "AliQADataMakerSim.h"
+
+class AliHMPIDQADataMakerSim: public AliQADataMakerSim {
+
+public:
+ AliHMPIDQADataMakerSim() ; // ctor
+ AliHMPIDQADataMakerSim(const AliHMPIDQADataMakerSim& qadm) ;
+ AliHMPIDQADataMakerSim& operator = (const AliHMPIDQADataMakerSim& qadm) ;
+ virtual ~AliHMPIDQADataMakerSim() {;} // dtor
+
+private:
+ virtual void InitHits() ; //book hit QA histo
+ virtual void InitDigits() ; //book Digit QA histo
+ virtual void InitSDigits() ; //book SDigits QA histo
+ virtual void MakeHits(TObject * hits) ; //Fill hit QA histo
+ virtual void MakeDigits(TObject * digits) ; //Fill Digit QA histo
+ virtual void MakeSDigits(TObject * sdigits) ; //Fill SDigit QA histo
+
+ TH1F *fhHitQdc; // Hit Q distr
+ TH2F *fhHitMap[7]; // Hit Q positions
+ TH1F *fhSDigits ; // SDigit Q distr
+ TH1F *fhDigPcEvt; // Pc occupancy per event
+ TH1F *fhDigChEvt; // Chamber occupancy per event
+ TH1F *fhDigQ; // Digit Q distr
+
+// TH1F *fhCluEvt; // N clusters per chamber
+// TH1F *fhCluChi2; // Chi2
+// TH1F *fhCluQ; // cluster Q distr
+// TH1F *fhCluFlg; // resolved cluster flag
+// TH1F *fhCluSize; // raw cluster size
+// TH1F *fhMipCluSize; // mip cluster size
+
+// TH2F *fhCkovP; // thetaC vs P
+// TH2F *fhSigP; // sigmaC vs P
+// TH2F *fhMipXY; // mip position on PC
+// TH2F *fhDifXY; // mip(X,Y) - extrapolated track(X,Y)
+// TH1F *fhPid[5]; // Pid responses
+
+ ClassDef(AliHMPIDQADataMakerSim,1) // description
+
+};
+
+#endif // AliHMPIDQADataMakerSim_H
#pragma link C++ class AliHMPIDCluster+;
#pragma link C++ class AliHMPIDParam+;
#pragma link C++ class AliHMPIDPreprocessor+;
-#pragma link C++ class AliHMPIDQADataMaker+;
#pragma link C++ class AliHMPIDQAChecker+;
#pragma link C++ class AliHMPIDCalib+;
#pragma link C++ class AliHMPIDRawStream+;
#pragma link C++ class AliHMPIDPid+;
#pragma link C++ class AliHMPIDRecoParam+;
#pragma link C++ class AliHMPIDReconHTA+;
+#pragma link C++ class AliHMPIDQADataMakerRec+;
+
#endif
#pragma link C++ class AliHMPIDv1+;
#pragma link C++ class AliHMPIDv2+;
#pragma link C++ class AliHMPIDDigitizer+;
+#pragma link C++ class AliHMPIDQADataMakerSim+;
+
#endif
SRCS:= AliHMPIDHit.cxx AliHMPIDDigit.cxx AliHMPIDCluster.cxx AliHMPIDParam.cxx AliHMPIDPreprocessor.cxx \
- AliHMPIDQADataMaker.cxx AliHMPIDQAChecker.cxx AliHMPIDCalib.cxx AliHMPIDRawStream.cxx
+ AliHMPIDQAChecker.cxx AliHMPIDCalib.cxx AliHMPIDRawStream.cxx
HDRS:= $(SRCS:.cxx=.h)
DHDR:= HMPIDbaseLinkDef.h
SRCS:= AliHMPIDReconstructor.cxx AliHMPIDTracker.cxx \
AliHMPIDRecon.cxx AliHMPIDRecoParam.cxx \
- AliHMPIDReconHTA.cxx AliHMPIDPid.cxx
+ AliHMPIDReconHTA.cxx AliHMPIDPid.cxx \
+ AliHMPIDQADataMakerRec.cxx
HDRS:= $(SRCS:.cxx=.h)
DHDR:= HMPIDrecLinkDef.h
-SRCS:= AliHMPID.cxx AliHMPIDv0.cxx AliHMPIDv1.cxx AliHMPIDv2.cxx AliHMPIDDigitizer.cxx
+SRCS:= AliHMPID.cxx AliHMPIDv0.cxx AliHMPIDv1.cxx AliHMPIDv2.cxx AliHMPIDDigitizer.cxx AliHMPIDQADataMakerSim.cxx
HDRS:= $(SRCS:.cxx=.h)
DHDR:= HMPIDsimLinkDef.h
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2007-2009, 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. *
+ **************************************************************************/
+
+/* $Id$ */
+
+// *************************************************************
+// Checks the quality assurance
+// by comparing with reference data
+// contained in a DB
+// -------------------------------------------------------------
+// W. Ferrarese Nov 2007
+// INFN Torino
+
+// --- ROOT system ---
+#include <TH2D.h>
+#include <TBranch.h>
+#include <TTree.h>
+#include <TGaxis.h>
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliITSQADataMakerRec.h"
+#include "AliLog.h"
+#include "AliQA.h"
+#include "AliQAChecker.h"
+#include "AliRawReader.h"
+#include "AliITSRawStreamSDD.h"
+#include "AliITSRecPoint.h"
+#include "AliITSgeomTGeo.h"
+#include "AliRawReader.h"
+
+
+ClassImp(AliITSQADataMakerRec)
+
+//____________________________________________________________________________
+AliITSQADataMakerRec::AliITSQADataMakerRec() :
+ AliQADataMakerRec(AliQA::GetDetName(AliQA::kITS), "SDD Quality Assurance Data Maker")
+{
+ fkOnline = kFALSE;
+ fnSDDHistos = 0;
+ // ctor
+}
+
+//____________________________________________________________________________
+AliITSQADataMakerRec::AliITSQADataMakerRec(Int_t ldc, Bool_t kMode) :
+ AliQADataMakerRec(AliQA::GetDetName(AliQA::kITS), "SDD Quality Assurance Data Maker")
+{
+ //ctor used to discriminate OnLine-Offline analysis
+ fkOnline = kMode;
+ fLDC = ldc;
+ fnSDDHistos = 0;
+}
+
+//____________________________________________________________________________
+AliITSQADataMakerRec::AliITSQADataMakerRec(const AliITSQADataMakerRec& qadm) :
+ AliQADataMakerRec()
+{
+ //copy ctor
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliITSQADataMakerRec& AliITSQADataMakerRec::operator = (const AliITSQADataMakerRec& qac )
+{
+ // Equal operator.
+ this->~AliITSQADataMakerRec();
+ new(this) AliITSQADataMakerRec(qac);
+ return *this;
+}
+
+//____________________________________________________________________________
+void AliITSQADataMakerRec::StartOfDetectorCycle() const
+{
+ //Detector specific actions at start of cycle
+ AliDebug(1,"AliITSQADM::Start of ITS Cycle\n");
+}
+
+//____________________________________________________________________________
+void AliITSQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray *list)
+{
+ // launch the QA checking
+ AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list)\n");
+
+ AliQAChecker::Instance()->Run( AliQA::kITS , task, list);
+}
+
+//____________________________________________________________________________
+void AliITSQADataMakerRec::EndOfDetectorCycle(const char * fgDataName)
+{
+ //eventually used for different AliQAChecker::Instance()->Run
+}
+
+//____________________________________________________________________________
+void AliITSQADataMakerRec::InitRaws()
+{
+ // create SDD histo of raw
+
+ Int_t lay, lad, det;
+
+ if(fkOnline) {
+ AliInfo("Book Online Histograms\n");
+ }
+ else {
+ AliInfo("Book Offline Histograms\n ");
+ }
+
+ TH1F *h0 = new TH1F("ModPattern","Modules pattern",fgknSDDmodules,-0.5,259.5);
+ Add2RawsList(h0,0);
+ fnSDDHistos++;
+ TH1F *h1 = new TH1F("ModPatternL3","Modules pattern L3",14,0.5,14.5);
+ Add2RawsList(h1,1);
+ fnSDDHistos++;
+ TH1F *h2 = new TH1F("ModPatternL4","Modules pattern L4",22,0.5,22.5);
+ Add2RawsList(h2,2);
+ fnSDDHistos++;
+
+ Char_t *hname0[fgkLADDonLAY3] ;
+ TH1D *h3[fgkLADDonLAY3] ;
+ for(Int_t i=1; i<=fgkLADDonLAY3; i++) {
+ hname0[i-1] = new Char_t[20];
+ sprintf(hname0[i-1],"ModPattern_L3_%d",i);
+ h3[i-1] = new TH1D(hname0[i-1],hname0[i-1],6,0.5,6.5);
+ Add2RawsList(h3[i-1],i-1+3);
+ fnSDDHistos++;
+ }
+
+ Char_t *hname1[fgkLADDonLAY4] ;
+ TH1D *h4[fgkLADDonLAY4] ;
+ for(Int_t i=1; i<=fgkLADDonLAY4; i++) {
+ hname1[i-1] = new Char_t[20];
+ sprintf(hname1[i-1],"ModPattern_L4_%d",i);
+ h4[i-1] = new TH1D(hname1[i-1],hname1[i-1],8,0.5,8.5);
+ Add2RawsList(h4[i-1],i-1+17);
+ fnSDDHistos++;
+ }
+
+ if(fkOnline) {
+ Int_t indexlast = 0;
+ Char_t *hname2[fgknSDDmodules*2] ;
+ TH1D *h5[fgknSDDmodules*2] ;
+ Int_t index1 = 0;
+ for(Int_t moduleSDD=0; moduleSDD<fgknSDDmodules; moduleSDD++){
+ if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) {
+ for(Int_t iside=0; iside<fgknSide; iside++){
+ //Int_t index1 = moduleSDD * 2 + iside;
+ hname2[index1] = new Char_t[50];
+ AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
+ sprintf(hname2[index1],"ProjYMap_L%d_%d_%d_%d",lay,lad,det,iside);
+
+ h5[index1] = new TH1D(hname2[index1],hname2[index1],256,-0.5,255.5);
+ Add2RawsList(h5[index1],index1+39);
+ fnSDDHistos++;
+ index1++;
+ indexlast = index1+39;
+ }
+ }
+ }
+
+ Char_t *hname3[fgknSDDmodules*8] ;
+ TH1D *h6[fgknSDDmodules*8] ;
+ Int_t indextot = 0;
+ Int_t indexlast1 = 0;
+ for(Int_t htype=0; htype<4; htype++){
+ for(Int_t moduleSDD=0; moduleSDD<fgknSDDmodules; moduleSDD++){
+ if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) {
+ for(Int_t iside=0; iside<fgknSide; iside++){
+ //Int_t index1 = moduleSDD*2 + iside;
+ hname3[indextot] = new Char_t[50];
+ AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
+ if(htype == 0) sprintf(hname3[indextot],"CountsVSAnode_L%d_%d_%d_%d",lay,lad,det,iside);
+ if(htype == 1) sprintf(hname3[indextot],"ChargeVSAnode_L%d_%d_%d_%d",lay,lad,det,iside);
+ if(htype == 2) sprintf(hname3[indextot],"CountsVSTbin_L%d_%d_%d_%d",lay,lad,det,iside);
+ if(htype == 3) sprintf(hname3[indextot],"ChargeVSTbin_L%d_%d_%d_%d",lay,lad,det,iside);
+ h6[indextot] = new TH1D(hname3[indextot],hname3[indextot],256,-0.5,255.5);
+ Add2RawsList(h6[indextot],indexlast + indextot);
+ fnSDDHistos++;
+ indextot++;
+ indexlast1 = indexlast + indextot;
+ }
+ }
+ }
+ }
+
+ Int_t indexlast2 = 0;
+ Char_t *hname4[fgknSDDmodules*2];
+ TH2D *h7[fgknSDDmodules*2] ;
+ index1 = 0;
+ for(Int_t moduleSDD=0; moduleSDD<fgknSDDmodules; moduleSDD++){
+ if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) {
+ for(Int_t iside=0; iside<fgknSide; iside++){
+ //Int_t index1 = moduleSDD * 2 + iside;
+ AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
+ hname4[index1] = new Char_t[50];
+ sprintf(hname4[index1],"Anode_vs_Charge_L%d_%d_%d_%d",lay,lad,det,iside);
+ h7[index1] = new TH2D(hname4[index1],hname4[index1],fgknSDDmodules*2,-0.5,-0.5+fgknSDDmodules*2,256,0.5,256.5);
+ Add2RawsList(h7[index1],indexlast1 + index1);
+ fnSDDHistos++;
+ index1++;
+ indexlast2 = indexlast1 + index1;
+ }
+ }
+ }
+
+ Char_t *hname[3][2 * fgknSDDmodules] ;
+ index1 = 0;
+ for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
+ if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) {
+ for(Int_t iside=0;iside<fgknSide;iside++){
+ //Int_t index1 = moduleSDD * 2 + iside ;
+ for(Int_t i=0; i<3; i++) hname[i][index1]= new Char_t[50];
+ AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
+ sprintf(hname[0][index1],"chargeMap_L%d_%d_%d_%d",lay,lad,det,iside);
+ sprintf(hname[1][index1],"TotalCharge_L%d_%d_%d_%d",lay,lad,det,iside);
+ sprintf(hname[2][index1],"hmonoDMap_L%d_%d_%d_%d",lay,lad,det,iside);
+ fModuleChargeMap[index1] = new TH2D(hname[0][index1],hname[1][index1],256,-0.5,255.5,256,-0.5,255.5);
+ Add2RawsList(fModuleChargeMap[index1],indexlast2 + index1);
+ fnSDDHistos++;
+ fmonoD[index1] = new TH1D(hname[2][index1],hname[2][index1],256,-0.5,255.5);
+ index1++;
+ }
+ }
+ }
+ }
+
+ AliDebug(1,Form("%d SDD histograms booked\n",fnSDDHistos));
+}
+
+//____________________________________________________________________________
+void AliITSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
+{
+ //Fills Raw QA list of histos
+ Int_t index=0;
+ if(fkOnline) {
+ for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
+ if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) {
+ for(Int_t iside=0;iside<fgknSide;iside++) {
+ if(fnSDDHistos > 39+12 * 132 + index) GetRawsData(39+12 * 132 + index)->Reset();
+ index++;
+ }
+ }
+ }
+ }
+ AliDebug(1,"entering MakeRaws\n");
+ rawReader->SelectEvents(7);
+ rawReader->SelectEquipment(17,fgkeqOffset+1,fgkeqOffset + fgkDDLidRange);
+ rawReader->Reset();
+ AliITSRawStreamSDD s(rawReader);
+ Int_t lay, lad, det;
+
+ Int_t cnt = 0;
+ while(s.Next()) {
+ Int_t iddl = rawReader->GetDDLID() - fgkDDLIDshift;
+ Int_t isddmod = s.GetModuleNumber(iddl,s.GetCarlosId());
+ if(s.IsCompletedModule()) {
+ AliDebug(1,Form("IsCompletedModule == KTRUE\n"));
+ continue;
+ }
+ Int_t coord1 = s.GetCoord1();
+ Int_t coord2 = s.GetCoord2();
+ Int_t signal = s.GetSignal();
+ Int_t moduleSDD = isddmod - fgkmodoffset;
+ if(moduleSDD < 0 || moduleSDD>fgknSDDmodules+fgkmodoffset) {
+ AliDebug(1,Form( "Module SDD = %d, resetting it to 1 \n",moduleSDD));
+ moduleSDD = 1;
+ }
+ GetRawsData(0)->Fill(moduleSDD);
+
+ AliITSgeomTGeo::GetModuleId(isddmod, lay, lad, det);
+ //printf("modnumb %d, lay %d, lad %d, det %d \n",isddmod, lay, lad, det);
+ Int_t ioffset = 3;
+ Int_t iorder = 1;
+ if(lay==4) {
+ ioffset += 14;
+ iorder = 2;
+ }
+ GetRawsData(iorder)->Fill(lad);
+ GetRawsData(ioffset+lad-1)->Fill(det); //-1 because ladder# starts from 1
+
+ Short_t iside = s.GetChannel();
+ Int_t activeModule = moduleSDD;
+ if(moduleSDD > 35) activeModule -= 48;
+ Int_t index1 = activeModule * 2 + iside;
+
+ if(index1<0){
+ AliDebug(1,Form("Wrong index number %d - patched to 0\n",index1));
+ index1 = 0;
+ }
+
+ if(fkOnline) {
+ if(fnSDDHistos > 39+12 * 132 + index1) {
+ GetRawsData(39+ 2 * 132 + index1)->Fill(coord1);
+ GetRawsData(39+ 4 * 132 + index1)->Fill(coord1,signal);
+ GetRawsData(39+ 6 * 132 + index1)->Fill(coord2);
+ GetRawsData(39+ 8 * 132 + index1)->Fill(coord2,signal);
+ GetRawsData(39+10 * 132 + index1)->Fill(signal,coord1);
+ ((TH2D *)(GetRawsData(39+12 * 132 + index1)))->Fill(coord2, coord1, signal);
+ }
+ }
+ cnt++;
+ if(!(cnt%10000)) AliDebug(1,Form(" %d raw digits read",cnt));
+ }
+ AliDebug(1,Form("Event completed, %d raw digits read",cnt));
+
+ if(fkOnline) {
+ Int_t nBins = 256;
+ for(Int_t moduleSDD=0; moduleSDD<fgknSDDmodules; moduleSDD++){
+ if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) {
+ for(Int_t iside=0; iside<fgknSide; iside++){
+ Int_t activeModule = moduleSDD;
+ if(moduleSDD > 35) activeModule -= 48;
+ Int_t index1 = activeModule * 2 + iside;
+ if(fnSDDHistos > 39 + 2 * 132 + index1) {
+ fmonoD[index1] = ((TH2D *) (GetRawsData(39+12 * 132 + index1)))->ProjectionY();
+ for(Int_t bin=0; bin<nBins; bin++) GetRawsData(index1+39)->Fill(bin,fmonoD[index1]->GetBinContent(bin+1) );
+ }
+ }
+ }
+ }
+ for(Int_t i=0; i<fnSDDHistos; i++){
+ Int_t entries = static_cast<Int_t>(GetRawsData(i)->GetEntries());
+ if(entries != 0)
+ AliDebug(1,Form("histo %d, name %s , entries %d ",i,GetRawsData(i)->GetName(),entries));
+ }
+ }
+}
+
+
+
+//____________________________________________________________________________
+void AliITSQADataMakerRec::InitRecPoints()
+{
+ // create SDD histo of RecPoints
+
+ TH1F * h0 = new TH1F("Lay3TotCh","Layer 3 total charge",1000,-0.5, 499.5);
+ Add2RecPointsList(h0, 0);
+
+ TH1F * h1 = new TH1F("Lay4TotCh","Layer 4 total charge",1000,-0.5, 499.5);
+ Add2RecPointsList(h1, 1);
+
+
+ Char_t *hisnam[3];
+ TH1F *h2[3];
+ for(Int_t i=1; i<=3; i++){
+ hisnam[i] = new Char_t[50];
+ sprintf(hisnam[i],"Charge_L3_Strip%d",i);
+ h2[i] = new TH1F(hisnam[i],hisnam[i],1000,-0.5, 499.5);
+ Add2RecPointsList(h2[i],i+1);
+ }
+
+ Char_t *hisnam2[4] ;
+ TH1F *h3[4];
+ for(Int_t i=1; i<=4; i++){
+ hisnam2[i] = new Char_t[50];
+ sprintf(hisnam2[i],"Charge_L4_Strip%d",i);
+ h3[i] = new TH1F(hisnam2[i],hisnam2[i],1000,-0.5, 499.5);
+ Add2RecPointsList(h3[i],i+4);
+ }
+
+}
+
+
+//____________________________________________________________________________
+void AliITSQADataMakerRec::MakeRecPoints(TTree * clustersTree)
+{
+ // makes data from RecPoints
+ /*
+ TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints");
+ if (!branchRecP) {
+ AliError("can't get the branch with the ITS clusters !");
+ return;
+ }
+ TObjArray * recpoints = new TObjArray(100) ;
+ branchRecP->SetAddress(&recpoints);
+ branchRecP->GetEntry(0);
+
+ TIter next(recpoints);
+ AliITSRecPoint * rp;
+ while ( rp = dynamic_cast<AliITSRecPoint *>(next()) ) {
+ if(rp->GetLayer() ==3) GetRecPointsData(0)->Fill( rp->GetQ()) ;
+ else if(rp->GetLayer() ==4) GetRecPointsData(1)->Fill( rp->GetQ()) ;
+ }
+ recpoints->Delete();
+ delete recpoints;
+ */
+}
+
+
--- /dev/null
+#ifndef AliITSQADataMakerRec_H
+#define AliITSQADataMakerRec_H
+/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+//
+// Checks the quality assurance.
+// By comparing with reference data
+// contained in a DB
+//
+//
+// W. Ferrarese Nov 2007
+
+
+
+
+#include "AliQADataMakerRec.h"
+class TObjArray;
+class TH1F;
+class TH2D;
+class AliRawReader;
+class AliITSgeomTGeo;
+
+class AliITSQADataMakerRec: public AliQADataMakerRec {
+
+public:
+ AliITSQADataMakerRec(); // ctor
+ AliITSQADataMakerRec(Int_t ldc, Bool_t kMode = kFALSE);
+ AliITSQADataMakerRec(const AliITSQADataMakerRec& qadm);
+ AliITSQADataMakerRec& operator = (const AliITSQADataMakerRec& qac);
+ virtual void StartOfDetectorCycle() const;
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list);
+ virtual void EndOfDetectorCycle(const char * fgDataName);
+ virtual void InitRaws();
+ virtual void InitRecPoints();
+ virtual void MakeRaws(AliRawReader *rawReader);
+ virtual void MakeRecPoints(TTree *clustersTree);
+ virtual ~AliITSQADataMakerRec() {;} // dtor
+
+private:
+
+ static const Int_t fgknSDDmodules = 260; //number of SDD modules
+ static const Int_t fgkmodoffset = 240; //number of SPD modules
+ static const Int_t fgknAnode = 256; //anode per half-module
+ static const Int_t fgknSide =2; //side per module
+ static const Int_t fgkeqOffset = 256; //DDL offset
+ static const Int_t fgkDDLidRange = 24; //number of DDL:so DDL range is 257-280
+ static const Int_t fgkDDLIDshift = 0; //necessary option until RawStream Table is complete
+ static const Int_t fgkLADDonLAY3 = 14; //number of ladder on layer 3
+ static const Int_t fgkLADDonLAY4 = 22; //number of ladder on layer 4
+
+ Bool_t fkOnline; //online (1) or offline (0) use
+ Int_t fLDC; //LDC number (0 for offline, 1 to 4 for online)
+ Int_t fnSDDHistos; // number of histogrma booked for SDDs
+ TH2D *fModuleChargeMap[2*fgknSDDmodules];//module map
+ TH1D *fmonoD[2*fgknSDDmodules] ; //histo used as support
+
+ ClassDef(AliITSQADataMakerRec,1) // description
+
+};
+
+#endif
+
+
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2007-2009, 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. *
+ **************************************************************************/
+
+/* $Id$ */
+
+// *************************************************************
+// Checks the quality assurance
+// by comparing with reference data
+// contained in a DB
+// -------------------------------------------------------------
+// W. Ferrarese Nov 2007
+// INFN Torino
+
+// --- ROOT system ---
+#include <TH2D.h>
+#include <TTree.h>
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliITSQADataMakerSim.h"
+#include "AliLog.h"
+#include "AliQAChecker.h"
+
+
+ClassImp(AliITSQADataMakerSim)
+
+//____________________________________________________________________________
+AliITSQADataMakerSim::AliITSQADataMakerSim() :
+ AliQADataMakerSim(AliQA::GetDetName(AliQA::kITS), "SDD Quality Assurance Data Maker")
+{
+ // ctor
+}
+
+//____________________________________________________________________________
+AliITSQADataMakerSim::AliITSQADataMakerSim(Int_t ldc, Bool_t kMode) :
+ AliQADataMakerSim(AliQA::GetDetName(AliQA::kITS), "SDD Quality Assurance Data Maker")
+{
+ //ctor used to discriminate OnLine-Offline analysis
+}
+
+//____________________________________________________________________________
+AliITSQADataMakerSim::AliITSQADataMakerSim(const AliITSQADataMakerSim& qadm) :
+ AliQADataMakerSim()
+{
+ //copy ctor
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliITSQADataMakerSim& AliITSQADataMakerSim::operator = (const AliITSQADataMakerSim& qac )
+{
+ // Equal operator.
+ this->~AliITSQADataMakerSim();
+ new(this) AliITSQADataMakerSim(qac);
+ return *this;
+}
+
+//____________________________________________________________________________
+void AliITSQADataMakerSim::StartOfDetectorCycle() const
+{
+ //Detector specific actions at start of cycle
+ AliDebug(1,"AliITSQADM::Start of ITS Cycle\n");
+}
+
+//____________________________________________________________________________
+void AliITSQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray *list)
+{
+ // launch the QA checking
+ AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list)\n");
+
+ AliQAChecker::Instance()->Run( AliQA::kITS , task, list);
+}
+
--- /dev/null
+#ifndef AliITSQADataMakerSim_H
+#define AliITSQADataMakerSim_H
+/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+//
+// Checks the quality assurance.
+// By comparing with reference data
+// contained in a DB
+//
+//
+// W. Ferrarese Nov 2007
+
+
+
+
+#include "AliQADataMakerSim.h"
+class TObjArray;
+class TH1F;
+class TH2D;
+class AliRawReader;
+class AliITSgeomTGeo;
+
+class AliITSQADataMakerSim: public AliQADataMakerSim {
+
+public:
+ AliITSQADataMakerSim(); // ctor
+ AliITSQADataMakerSim(Int_t ldc, Bool_t kMode = kFALSE);
+ AliITSQADataMakerSim(const AliITSQADataMakerSim& qadm);
+ AliITSQADataMakerSim& operator = (const AliITSQADataMakerSim& qac);
+ virtual void StartOfDetectorCycle() const;
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list);
+ virtual ~AliITSQADataMakerSim() {;} // dtor
+
+private:
+
+ ClassDef(AliITSQADataMakerSim,1) // description
+
+};
+
+#endif
+
+
#pragma link C++ class AliITSAlignMille+;
// Classes for QA
#pragma link C++ class AliITSQAChecker+;
-#pragma link C++ class AliITSQADataMaker+;
+#pragma link C++ class AliITSQADataMakerRec+;
#endif
// Raw data
#pragma link C++ class AliITSTrigger+;
+#pragma link C++ class AliITSQADataMakerSim+;
+
AliITSPreprocessorSSD.cxx \
AliITSAlignMille.cxx \
AliITSQAChecker.cxx \
- AliITSQADataMaker.cxx \
+ AliITSQADataMakerRec.cxx
HDRS:= $(SRCS:.cxx=.h)
AliITSv11GeomCableFlat.cxx \
AliITSv11GeomCableRound.cxx \
AliITSv11GeometrySDD.cxx \
- AliITSv11GeometrySSD.cxx \
- AliITSv11GeometrySPD.cxx \
- AliITSv11Hybrid.cxx \
- AliITSv11GeometrySupport.cxx
+ AliITSv11GeometrySSD.cxx \
+ AliITSv11GeometrySPD.cxx \
+ AliITSv11Hybrid.cxx \
+ AliITSv11GeometrySupport.cxx \
+ AliITSQADataMakerSim.cxx
+
HDRS:= $(SRCS:.cxx=.h)
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TH1F.h>
+#include <TH1I.h>
+#include <TH2F.h>
+#include <TLorentzVector.h>
+
+// --- AliRoot header files ---
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliRawReader.h"
+#include "AliQAChecker.h"
+#include "AliMUONCluster.h"
+#include "AliMUONRawStreamTracker.h"
+#include "AliMUONRawStreamTrigger.h"
+
+#include "AliMUONVClusterStore.h"
+#include "AliMUONVCluster.h"
+#include "AliESDMuonTrack.h"
+
+#include "AliMUONQADataMakerRec.h"
+
+//-----------------------------------------------------------------------------
+/// \class AliMUONQADataMakerRec
+///
+/// MUON base class for quality assurance data (histo) maker
+///
+/// \author C. Finck
+
+/// \cond CLASSIMP
+ClassImp(AliMUONQADataMakerRec)
+/// \endcond
+
+//____________________________________________________________________________
+AliMUONQADataMakerRec::AliMUONQADataMakerRec() :
+ AliQADataMakerRec(AliQA::GetDetName(AliQA::kMUON), "MUON Quality Assurance Data Maker"),
+ fClusterStore(0x0)
+{
+ /// ctor
+}
+
+//____________________________________________________________________________
+AliMUONQADataMakerRec::AliMUONQADataMakerRec(const AliMUONQADataMakerRec& qadm) :
+ AliQADataMakerRec()
+{
+ ///copy ctor
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliMUONQADataMakerRec& AliMUONQADataMakerRec::operator = (const AliMUONQADataMakerRec& qadm )
+{
+ /// Equal operator.
+ this->~AliMUONQADataMakerRec();
+ new(this) AliMUONQADataMakerRec(qadm);
+ return *this;
+}
+
+//__________________________________________________________________
+AliMUONQADataMakerRec::~AliMUONQADataMakerRec()
+{
+ /// dtor
+ delete fClusterStore;
+}
+
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray* list)
+{
+ ///Detector specific actions at end of cycle
+ // do the QA checking
+ AliQAChecker::Instance()->Run(AliQA::kMUON, task, list) ;
+}
+
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::InitRaws()
+{
+ /// create Raws histograms in Raws subdir
+ TH1I* h0 = new TH1I("hRawBusPatch", "buspatch distribution", 1932, 1, 1932);
+ Add2RawsList(h0, 0);
+
+ TH1I* h1 = new TH1I("hRawCharge", "Charge distribution in rawdata", 4096, 0, 4095);
+ Add2RawsList(h1, 1);
+
+}
+
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::InitRecPoints()
+{
+ /// create Reconstructed Points histograms in RecPoints subdir
+ TH1F* h0 = new TH1F("hClusterCharge", "Clusters Charge distribution", 1000, 0., 4095.);
+ Add2RecPointsList(h0, 0);
+
+ TH1I* h1 = new TH1I("hClusterDetElem", "DetElemId distribution in Clusters ", 1000, 100., 1100.);
+ Add2RecPointsList(h1, 1);
+}
+
+
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::InitESDs()
+{
+ ///create ESDs histograms in ESDs subdir
+ TH1F* h0 = new TH1F("hESDnTracks", "ESDs track number distribution", 30, 0., 30.);
+ Add2ESDsList(h0, 0);
+
+ TH1F* h1 = new TH1F("hESDMomentum", "ESDs P distribution", 300, 0., 300) ;
+ Add2ESDsList(h1, 1);
+
+ TH1F* h2 = new TH1F("hESDPt", "ESDs Pt distribution", 200, 0., 50) ;
+ Add2ESDsList(h2, 2) ;
+
+ TH1F* h3 = new TH1F("hESDRapidity", "ESDs rapidity distribution", 200, -4.5,-2.) ;
+ Add2ESDsList(h3, 3) ;
+}
+
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
+{
+ /// make QA for rawdata
+ Int_t busPatchId;
+ UShort_t manuId;
+ UChar_t channelId;
+ UShort_t charge;
+
+ rawReader->Reset();
+ AliMUONRawStreamTracker rawStream(rawReader);
+ rawStream.First();
+ while( rawStream.Next(busPatchId, manuId, channelId, charge) ) {
+
+ GetRawsData(0)->Fill(busPatchId);
+ GetRawsData(1)->Fill(charge);
+
+ } // Next digit
+
+}
+
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree)
+{
+
+ /// makes data from RecPoints
+ if (!fClusterStore)
+ fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
+ fClusterStore->Connect(*clustersTree, false);
+ clustersTree->GetEvent(0);
+
+ TIter next(fClusterStore->CreateIterator());
+
+ AliMUONVCluster* clus = 0x0;
+
+ while ( ( clus = static_cast<AliMUONVCluster*>(next()) ) )
+ {
+ GetRecPointsData(0)->Fill(clus->GetCharge());
+ GetRecPointsData(1)->Fill(clus->GetDetElemId());
+ }
+}
+
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd)
+{
+ /// make QA data from ESDs
+
+ TLorentzVector v1;
+
+ Int_t nTracks = (Int_t)esd->GetNumberOfMuonTracks() ;
+ GetESDsData(0)->Fill(nTracks);
+
+ for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
+
+ AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iTrack);
+ muonTrack->LorentzP(v1);
+
+ GetESDsData(1)->Fill(v1.P());
+ GetESDsData(2)->Fill(v1.Pt());
+ GetESDsData(3)->Fill(v1.Rapidity());
+ }
+}
+
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::StartOfDetectorCycle()
+{
+ /// Detector specific actions at start of cycle
+
+}
--- /dev/null
+#ifndef AliMUONQADataMakerRec_H
+#define AliMUONQADataMakerRec_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/// \ingroup rec
+/// \class AliMUONQADataMakerRec
+/// \brief MUON Quality assurance data maker
+///
+// Author Christian Finck
+
+// dummy function for simulation part
+// to avoid circular dependencie
+
+// --- ROOT system ---
+class TObjArray;
+
+// --- AliRoot header files ---
+class AliMUONVClusterStore;
+class AliMUONVTrackStore;
+
+#include "AliQADataMakerRec.h"
+
+class AliMUONQADataMakerRec: public AliQADataMakerRec {
+
+public:
+ AliMUONQADataMakerRec();
+ AliMUONQADataMakerRec(const AliMUONQADataMakerRec& qadm);
+ AliMUONQADataMakerRec& operator=(const AliMUONQADataMakerRec& qadm);
+ virtual ~AliMUONQADataMakerRec();
+
+private:
+ virtual void StartOfDetectorCycle();
+
+ virtual void InitRaws();
+ virtual void InitRecPoints();
+ virtual void InitESDs();
+
+ virtual void MakeRaws(AliRawReader* rawReader);
+ virtual void MakeRecPoints(TTree* recpo);
+ virtual void MakeESDs(AliESDEvent* esd) ;
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray* list);
+
+ AliMUONVClusterStore* fClusterStore; //!< pointer to cluster store
+
+ ClassDef(AliMUONQADataMakerRec,1) // MUON Quality assurance data maker
+
+};
+#endif
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TH1F.h>
+#include <TH1I.h>
+#include <TH2F.h>
+#include <TLorentzVector.h>
+
+// --- AliRoot header files ---
+#include "AliLog.h"
+#include "AliQAChecker.h"
+
+#include "AliMUONQADataMakerSim.h"
+
+//-----------------------------------------------------------------------------
+/// \class AliMUONQADataMakerSim
+///
+/// MUON base class for quality assurance data (histo) maker
+///
+/// \author C. Finck
+
+/// \cond CLASSIMP
+ClassImp(AliMUONQADataMakerSim)
+/// \endcond
+
+//____________________________________________________________________________
+AliMUONQADataMakerSim::AliMUONQADataMakerSim() :
+ AliQADataMakerSim(AliQA::GetDetName(AliQA::kMUON), "MUON Quality Assurance Data Maker")
+{
+ /// ctor
+}
+
+//____________________________________________________________________________
+AliMUONQADataMakerSim::AliMUONQADataMakerSim(const AliMUONQADataMakerSim& qadm) :
+ AliQADataMakerSim()
+{
+ ///copy ctor
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliMUONQADataMakerSim& AliMUONQADataMakerSim::operator = (const AliMUONQADataMakerSim& qadm )
+{
+ /// Equal operator.
+ this->~AliMUONQADataMakerSim();
+ new(this) AliMUONQADataMakerSim(qadm);
+ return *this;
+}
+
+//__________________________________________________________________
+AliMUONQADataMakerSim::~AliMUONQADataMakerSim()
+{
+ /// dtor
+}
+
+//____________________________________________________________________________
+void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray* list)
+{
+ ///Detector specific actions at end of cycle
+ // do the QA checking
+ AliQAChecker::Instance()->Run(AliQA::kMUON, task, list) ;
+}
+
+
+//____________________________________________________________________________
+void AliMUONQADataMakerSim::StartOfDetectorCycle()
+{
+ /// Detector specific actions at start of cycle
+
+}
--- /dev/null
+#ifndef AliMUONQADataMakerSim_H
+#define AliMUONQADataMakerSim_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/// \ingroup rec
+/// \class AliMUONQADataMakerSim
+/// \brief MUON Quality assurance data maker
+///
+// Author Christian Finck
+
+// dummy function for simulation part
+// to avoid circular dependencie
+
+// --- ROOT system ---
+class TObjArray;
+
+// --- AliRoot header files ---
+class AliMUONVClusterStore;
+class AliMUONVTrackStore;
+
+#include "AliQADataMakerSim.h"
+
+class AliMUONQADataMakerSim: public AliQADataMakerSim {
+
+public:
+ AliMUONQADataMakerSim();
+ AliMUONQADataMakerSim(const AliMUONQADataMakerSim& qadm);
+ AliMUONQADataMakerSim& operator=(const AliMUONQADataMakerSim& qadm);
+ virtual ~AliMUONQADataMakerSim();
+
+private:
+ virtual void StartOfDetectorCycle();
+ /// init hits QA from Array (not implemented)
+ virtual void InitHits() {return;}
+ /// init SDigits QA from Array (not implemented)
+ virtual void InitSDigits() {return;}
+ /// init SDigits QA from Array (not implemented)
+ virtual void InitDigits() {return;}
+
+ /// make hits QA from Array (not implemented)
+ virtual void MakeHits(TClonesArray* /*hits*/) {return;}
+ /// make hits QA from tree (not implemented)
+ virtual void MakeHits(TTree* /*hits*/) {return;}
+ /// make SDigits QA from Array (not implemented)
+ virtual void MakeSDigits(TClonesArray* /*sigits*/) {return;}
+ /// make SDigits QA from Tree (not implemented)
+ virtual void MakeSDigits(TTree* /*sigits*/) {return;}
+ /// make Digits QA from Array (not implemented)
+ virtual void MakeDigits(TClonesArray* /*digits*/) {return;}
+ /// make SDigits QA from Tree (not implemented)
+ virtual void MakeDigits(TTree* /*digits*/) {return;}
+
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray* list);
+
+ ClassDef(AliMUONQADataMakerSim,1) // MUON Quality assurance data maker
+
+};
+#endif
#pragma link C++ class AliMUONPadStatusMapMaker+;
// QA
-#pragma link C++ class AliMUONQADataMaker+;
+#pragma link C++ class AliMUONQADataMakerRec+;
#pragma link C++ class AliMUONQAChecker+;
#endif
#pragma link C++ class AliMUONPedestalEventGenerator+;
#pragma link C++ class AliMUONGainEventGenerator+;
+#pragma link C++ class AliMUONQADataMakerSim+;
+
#endif
AliMUONHitStoreV1.cxx \
AliMUONMCDataInterface.cxx \
AliMUONPedestalEventGenerator.cxx \
- AliMUONGainEventGenerator.cxx
+ AliMUONGainEventGenerator.cxx \
+ AliMUONQADataMakerSim.cxx
+
HDRS:= $(SRCS:.cxx=.h)
/* History of cvs commits:
*
* $Log$
+ * Revision 1.103 2007/11/07 11:25:06 schutz
+ * Comment out the QA checking before starting digitization
+ *
* Revision 1.102 2007/10/19 18:04:29 schutz
* The standalone QA data maker is called from AliSimulation and AliReconstruction outside the event loop; i.e. re-reading the data. The QA data making in the event loop has been commented out.
*
#include "AliPHOSSDigitizer.h"
#include "AliPHOSGeometry.h"
#include "AliPHOSTick.h"
-#include "AliPHOSQADataMaker.h"
ClassImp(AliPHOSDigitizer)
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+
+/* $Id$ */
+
+/*
+ Produces the data needed to calculate the quality assurance.
+ All data must be mergeable objects.
+ Y. Schutz CERN July 2007
+*/
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TH1F.h>
+#include <TH1I.h>
+#include <TH2F.h>
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliESDCaloCluster.h"
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliPHOSQADataMakerRec.h"
+#include "AliQAChecker.h"
+#include "AliPHOSCpvRecPoint.h"
+#include "AliPHOSEmcRecPoint.h"
+#include "AliPHOSRecParticle.h"
+#include "AliPHOSTrackSegment.h"
+#include "AliPHOSRawDecoder.h"
+#include "AliPHOSReconstructor.h"
+#include "AliPHOSRecoParam.h"
+
+ClassImp(AliPHOSQADataMakerRec)
+
+//____________________________________________________________________________
+ AliPHOSQADataMakerRec::AliPHOSQADataMakerRec() :
+ AliQADataMakerRec(AliQA::GetDetName(AliQA::kPHOS), "PHOS Quality Assurance Data Maker")
+{
+ // ctor
+}
+
+//____________________________________________________________________________
+AliPHOSQADataMakerRec::AliPHOSQADataMakerRec(const AliPHOSQADataMakerRec& qadm) :
+ AliQADataMakerRec()
+{
+ //copy ctor
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliPHOSQADataMakerRec& AliPHOSQADataMakerRec::operator = (const AliPHOSQADataMakerRec& qadm )
+{
+ // Equal operator.
+ this->~AliPHOSQADataMakerRec();
+ new(this) AliPHOSQADataMakerRec(qadm);
+ return *this;
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+{
+ //Detector specific actions at end of cycle
+ // do the QA checking
+ AliQAChecker::Instance()->Run(AliQA::kPHOS, task, list) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerRec::InitESDs()
+{
+ //create ESDs histograms in ESDs subdir
+
+ TH1F * h0 = new TH1F("hPhosESDs", "ESDs energy distribution in PHOS", 100, 0., 100.) ;
+ h0->Sumw2() ;
+ Add2ESDsList(h0, 0) ;
+ TH1I * h1 = new TH1I("hPhosESDsMul", "ESDs multiplicity distribution in PHOS", 100, 0., 100) ;
+ h1->Sumw2() ;
+ Add2ESDsList(h1, 1) ;
+}
+
+//____________________________________________________________________________
+//void AliPHOSQADataMakerRec::InitRecParticles()
+//{
+// // create Reconstructed particles histograms in RecParticles subdir
+// fhRecParticles = new TH1F("hPhosRecParticles", "RecParticles energy distribution in PHOS", 100, 0., 100.) ;
+// fhRecParticles->Sumw2() ;
+// fhRecParticlesMul = new TH1I("hPhosRecParticlesMul", "RecParticles multiplicity distribution in PHOS", 100, 0, 100) ;
+// fhRecParticlesMul->Sumw2() ;
+//}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerRec::InitRecPoints()
+{
+ // create Reconstructed Points histograms in RecPoints subdir
+ TH1F * h0 = new TH1F("hEmcPhosRecPoints", "EMCA RecPoints energy distribution in PHOS", 100, 0., 100.) ;
+ h0->Sumw2() ;
+ Add2RecPointsList(h0, 0) ;
+ TH1I * h1 = new TH1I("hEmcPhosRecPointsMul", "EMCA RecPoints multiplicity distribution in PHOS", 100, 0, 100) ;
+ h1->Sumw2() ;
+ Add2RecPointsList(h1, 1) ;
+
+ TH1F * h2 = new TH1F("hCpvPhosRecPoints", "CPV RecPoints energy distribution in PHOS", 100, 0., 100.) ;
+ h2->Sumw2() ;
+ Add2RecPointsList(h2, 2) ;
+ TH1I * h3 = new TH1I("hCpvPhosRecPointsMul", "CPV RecPoints multiplicity distribution in PHOS", 100, 0, 100) ;
+ h3->Sumw2() ;
+ Add2RecPointsList(h3, 3) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerRec::InitRaws()
+{
+ // create Raws histograms in Raws subdir
+ const Int_t modMax = 5 ;
+ TH2I * h0[modMax*2] ;
+ char name[32] ;
+ char title[32] ;
+ for (Int_t mod = 0; mod < modMax; mod++) {
+ sprintf(title, "Low Gain Rows x Columns for PHOS module %d", mod) ;
+ sprintf(name, "hLowPHOSxyMod%d", mod) ;
+ h0[mod] = new TH2I(name, title, 64, 1, 65, 56, 1, 57) ;
+ Add2RawsList(h0[mod], mod) ;
+ sprintf(title, "High Gain Rows x Columns for PHOS module %d", mod) ;
+ sprintf(name, "hHighPHOSxyMod%d", mod) ;
+ h0[mod+modMax] = new TH2I(name, title, 64, 1, 65, 56, 1, 57) ;
+ Add2RawsList(h0[mod+modMax], mod+modMax) ;
+ }
+ TH1I * h10 = new TH1I("hLowPhosModules", "Low Gain Hits in EMCA PHOS modules", 6, 0, 6) ;
+ h10->Sumw2() ;
+ Add2RawsList(h10, 10) ;
+ TH1I * h11 = new TH1I("hHighPhosModules", "High Gain Hits in EMCA PHOS modules", 6, 0, 6) ;
+ h11->Sumw2() ;
+ Add2RawsList(h11, 11) ;
+ TH1F * h12 = new TH1F("hLowPhosRawtime", "Low Gain Time of raw hits in PHOS", 100, 0, 100.) ;
+ h12->Sumw2() ;
+ Add2RawsList(h12, 12) ;
+ TH1F * h13 = new TH1F("hHighPhosRawtime", "High Gain Time of raw hits in PHOS", 100, 0, 100.) ;
+ h13->Sumw2() ;
+ Add2RawsList(h13, 13) ;
+ TH1F * h14 = new TH1F("hLowPhosRawEnergy", "Low Gain Energy of raw hits in PHOS", 100, 0., 100.) ;
+ h14->Sumw2() ;
+ Add2RawsList(h14, 14) ;
+ TH1F * h15 = new TH1F("hHighPhosRawEnergy", "High Gain Energy of raw hits in PHOS", 100, 0., 100.) ;
+ h15->Sumw2() ;
+ Add2RawsList(h15, 15) ;
+
+}
+
+//____________________________________________________________________________
+//void AliPHOSQADataMakerRec::InitTrackSegments()
+//{
+// // create Track Segments histograms in TrackSegments subdir
+// fhTrackSegments = new TH1F("hPhosTrackSegments", "TrackSegments EMC-CPV distance in PHOS", 500, 0., 5000.) ;
+// fhTrackSegments->Sumw2() ;
+// fhTrackSegmentsMul = new TH1I("hPhosTrackSegmentsMul", "TrackSegments multiplicity distribution in PHOS", 100, 0, 100) ;
+// fhTrackSegmentsMul->Sumw2() ;
+//}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerRec::MakeESDs(AliESDEvent * esd)
+{
+ // make QA data from ESDs
+
+ Int_t count = 0 ;
+ for ( Int_t index = 0; index < esd->GetNumberOfCaloClusters() ; index++ ) {
+ AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
+ if ( clu->IsPHOS() ) {
+ GetESDsData(0)->Fill(clu->E()) ;
+ count++ ;
+ }
+ }
+ GetESDsData(1)->Fill(count) ;
+}
+
+//____________________________________________________________________________
+// void AliPHOSQADataMakerRec::MakeRecParticles(TTree * recpar)
+// {
+// // makes data from RecParticles
+
+// TClonesArray * recparticles = dynamic_cast<TClonesArray*>(fData) ;
+// fhRecParticlesMul->Fill(recparticles->GetEntriesFast()) ;
+// TIter next(recparticles) ;
+// AliPHOSRecParticle * recparticle ;
+// while ( (recparticle = dynamic_cast<AliPHOSRecParticle *>(next())) ) {
+// fhRecParticles->Fill( recparticle->Energy()) ;
+// }
+// }
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
+{
+ const Int_t modMax = 5 ;
+ rawReader->Reset() ;
+ AliPHOSRawDecoder decoder(rawReader);
+ decoder.SetOldRCUFormat(kFALSE);
+ decoder.SubtractPedestals(AliPHOSReconstructor::GetRecoParamEmc()->SubtractPedestals());
+ Int_t count = 0 ;
+ while (decoder.NextDigit()) {
+ Int_t module = decoder.GetModule() ;
+ Int_t row = decoder.GetRow() ;
+ Int_t col = decoder.GetColumn() ;
+ Double_t time = decoder.GetTime() ;
+ Double_t energy = decoder.GetEnergy() ;
+ Bool_t lowGain = decoder.IsLowGain();
+ if (lowGain) {
+ GetRawsData(module)->Fill(row, col) ;
+ GetRawsData(10)->Fill(module) ;
+ GetRawsData(12)->Fill(time) ;
+ GetRawsData(14)->Fill(energy) ;
+ } else {
+ GetRawsData(module+modMax)->Fill(row, col) ;
+ GetRawsData(11)->Fill(module) ;
+ GetRawsData(13)->Fill(time) ;
+ GetRawsData(15)->Fill(energy) ;
+ }
+ //AliInfo(Form(" %d %d %d %d %f %f\n", count, module, row, col, time, energy)) ;
+ count++ ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerRec::MakeRecPoints(TTree * clustersTree)
+{
+ {
+ // makes data from RecPoints
+ TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
+ if (!emcbranch) {
+ AliError("can't get the branch with the PHOS EMC clusters !");
+ return;
+ }
+ TObjArray * emcrecpoints = new TObjArray(100) ;
+ emcbranch->SetAddress(&emcrecpoints);
+ emcbranch->GetEntry(0);
+
+ GetRecPointsData(1)->Fill(emcrecpoints->GetEntriesFast()) ;
+ TIter next(emcrecpoints) ;
+ AliPHOSEmcRecPoint * rp ;
+ while ( (rp = dynamic_cast<AliPHOSEmcRecPoint *>(next())) ) {
+ GetRecPointsData(0)->Fill( rp->GetEnergy()) ;
+ }
+ emcrecpoints->Delete();
+ delete emcrecpoints;
+ }
+ {
+ TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
+ if (!cpvbranch) {
+ AliError("can't get the branch with the PHOS CPV clusters !");
+ return;
+ }
+ TObjArray *cpvrecpoints = new TObjArray(100) ;
+ cpvbranch->SetAddress(&cpvrecpoints);
+ cpvbranch->GetEntry(0);
+
+ GetRecPointsData(1)->Fill(cpvrecpoints->GetEntriesFast()) ;
+ TIter next(cpvrecpoints) ;
+ AliPHOSCpvRecPoint * rp ;
+ while ( (rp = dynamic_cast<AliPHOSCpvRecPoint *>(next())) ) {
+ GetRecPointsData(0)->Fill( rp->GetEnergy()) ;
+ }
+ cpvrecpoints->Delete();
+ delete cpvrecpoints;
+ }
+}
+
+//____________________________________________________________________________
+// void AliPHOSQADataMakerRec::MakeTrackSegments(TTree * ts)
+// {
+// // makes data from TrackSegments
+
+// TClonesArray * tracksegments = dynamic_cast<TClonesArray*>(fData) ;
+
+// fhTrackSegmentsMul->Fill(tracksegments->GetEntriesFast()) ;
+// TIter next(tracksegments) ;
+// AliPHOSTrackSegment * ts ;
+// while ( (ts = dynamic_cast<AliPHOSTrackSegment *>(next())) ) {
+// fhTrackSegments->Fill( ts->GetCpvDistance()) ;
+// }
+// }
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerRec::StartOfDetectorCycle()
+{
+ //Detector specific actions at start of cycle
+
+}
--- /dev/null
+#ifndef ALIPHOSQADataMakerRec_H
+#define ALIPHOSQADataMakerRec_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+/*
+ Produces the data needed to calculate the quality assurance.
+ All data must be mergeable objects.
+ Y. Schutz CERN July 2007
+*/
+
+
+// --- ROOT system ---
+class TH1F ;
+class TH1I ;
+class TObjArray ;
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliQADataMakerRec.h"
+
+class AliPHOSQADataMakerRec: public AliQADataMakerRec {
+
+public:
+ AliPHOSQADataMakerRec() ; // ctor
+ AliPHOSQADataMakerRec(const AliPHOSQADataMakerRec& qadm) ;
+ AliPHOSQADataMakerRec& operator = (const AliPHOSQADataMakerRec& qadm) ;
+ virtual ~AliPHOSQADataMakerRec() {;} // dtor
+
+private:
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * list) ;
+ virtual void InitESDs() ;
+ //virtual void InitRecParticles() ;
+ virtual void InitRecPoints() ;
+ virtual void InitRaws() ;
+ //virtual void InitTrackSegments() ;
+ virtual void MakeESDs(AliESDEvent * esd) ;
+ // virtual void MakeRecParticles(TTree * recpar) ;
+ virtual void MakeRecPoints(TTree * recpoTree) ;
+ virtual void MakeRaws(AliRawReader* rawReader) ;
+ //virtual void MakeTrackSegments(TTree *ts ) ;
+ virtual void StartOfDetectorCycle() ;
+
+ ClassDef(AliPHOSQADataMakerRec,1) // description
+
+};
+
+#endif // AliPHOSQADataMakerRec_H
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+
+/* $Id$ */
+
+/*
+ Produces the data needed to calculate the quality assurance.
+ All data must be mergeable objects.
+ Y. Schutz CERN July 2007
+*/
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TH1F.h>
+#include <TH1I.h>
+#include <TH2F.h>
+#include <TTree.h>
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliESDCaloCluster.h"
+#include "AliLog.h"
+#include "AliPHOSDigit.h"
+#include "AliPHOSHit.h"
+#include "AliPHOSQADataMakerSim.h"
+#include "AliQAChecker.h"
+
+ClassImp(AliPHOSQADataMakerSim)
+
+//____________________________________________________________________________
+ AliPHOSQADataMakerSim::AliPHOSQADataMakerSim() :
+ AliQADataMakerSim(AliQA::GetDetName(AliQA::kPHOS), "PHOS Quality Assurance Data Maker")
+{
+ // ctor
+}
+
+//____________________________________________________________________________
+AliPHOSQADataMakerSim::AliPHOSQADataMakerSim(const AliPHOSQADataMakerSim& qadm) :
+ AliQADataMakerSim()
+{
+ //copy ctor
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliPHOSQADataMakerSim& AliPHOSQADataMakerSim::operator = (const AliPHOSQADataMakerSim& qadm )
+{
+ // Assign operator.
+ this->~AliPHOSQADataMakerSim();
+ new(this) AliPHOSQADataMakerSim(qadm);
+ return *this;
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+{
+ //Detector specific actions at end of cycle
+ // do the QA checking
+ AliQAChecker::Instance()->Run(AliQA::kPHOS, task, list) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerSim::InitHits()
+{
+ // create Hits histograms in Hits subdir
+ TH1F * h0 = new TH1F("hPhosHits", "Hits energy distribution in PHOS", 100, 0., 100.) ;
+ h0->Sumw2() ;
+ Add2HitsList(h0, 0) ;
+ TH1I * h1 = new TH1I("hPhosHitsMul", "Hits multiplicity distribution in PHOS", 500, 0., 10000) ;
+ h1->Sumw2() ;
+ Add2HitsList(h1, 1) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerSim::InitDigits()
+{
+ // create Digits histograms in Digits subdir
+ TH1I * h0 = new TH1I("hPhosDigits", "Digits amplitude distribution in PHOS", 500, 0, 5000) ;
+ h0->Sumw2() ;
+ Add2DigitsList(h0, 0) ;
+ TH1I * h1 = new TH1I("hPhosDigitsMul", "Digits multiplicity distribution in PHOS", 500, 0, 1000) ;
+ h1->Sumw2() ;
+ Add2DigitsList(h1, 1) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerSim::InitSDigits()
+{
+ // create SDigits histograms in SDigits subdir
+ TH1F * h0 = new TH1F("hPhosSDigits", "SDigits energy distribution in PHOS", 100, 0., 100.) ;
+ h0->Sumw2() ;
+ Add2SDigitsList(h0, 0) ;
+ TH1I * h1 = new TH1I("hPhosSDigitsMul", "SDigits multiplicity distribution in PHOS", 500, 0, 10000) ;
+ h1->Sumw2() ;
+ Add2SDigitsList(h1, 1) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerSim::MakeHits(TClonesArray * hits)
+{
+ //make QA data from Hits
+
+ GetHitsData(1)->Fill(hits->GetEntriesFast()) ;
+ TIter next(hits) ;
+ AliPHOSHit * hit ;
+ while ( (hit = dynamic_cast<AliPHOSHit *>(next())) ) {
+ GetHitsData(0)->Fill( hit->GetEnergy()) ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerSim::MakeHits(TTree * hitTree)
+{
+ // make QA data from Hit Tree
+
+ TClonesArray * hits = new TClonesArray("AliPHOSHit", 1000);
+
+ TBranch * branch = hitTree->GetBranch("PHOS") ;
+ if ( ! branch ) {
+ AliWarning("PHOS branch in Hit Tree not found") ;
+ } else {
+ TClonesArray * tmp = new TClonesArray("AliPHOSHit", 1000) ;
+ branch->SetAddress(&tmp) ;
+ Int_t index = 0 ;
+ for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
+ branch->GetEntry(ientry) ;
+ for (Int_t ihit = 0 ; ihit < tmp->GetEntries() ; ihit++) {
+ AliPHOSHit * hit = dynamic_cast<AliPHOSHit *> (tmp->At(ihit)) ;
+ new((*hits)[index]) AliPHOSHit(*hit) ;
+ index++ ;
+ }
+ }
+ tmp->Delete() ;
+ delete tmp ;
+ MakeHits(hits) ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerSim::MakeDigits(TClonesArray * digits)
+{
+ // makes data from Digits
+
+ GetDigitsData(1)->Fill(digits->GetEntriesFast()) ;
+ TIter next(digits) ;
+ AliPHOSDigit * digit ;
+ while ( (digit = dynamic_cast<AliPHOSDigit *>(next())) ) {
+ GetDigitsData(0)->Fill( digit->GetEnergy()) ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerSim::MakeDigits(TTree * digitTree)
+{
+ // makes data from Digit Tree
+ TClonesArray * digits = new TClonesArray("AliPHOSDigit", 1000) ;
+
+ TBranch * branch = digitTree->GetBranch("PHOS") ;
+ if ( ! branch ) {
+ AliWarning("PHOS branch in Digit Tree not found") ;
+ } else {
+ branch->SetAddress(&digits) ;
+ branch->GetEntry(0) ;
+ MakeDigits(digits) ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerSim::MakeSDigits(TClonesArray * sdigits)
+{
+ // makes data from SDigits
+
+ GetSDigitsData(1)->Fill(sdigits->GetEntriesFast()) ;
+ TIter next(sdigits) ;
+ AliPHOSDigit * sdigit ;
+ while ( (sdigit = dynamic_cast<AliPHOSDigit *>(next())) ) {
+ GetSDigitsData(0)->Fill( sdigit->GetEnergy()) ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerSim::MakeSDigits(TTree * sdigitTree)
+{
+ // makes data from SDigit Tree
+ TClonesArray * sdigits = new TClonesArray("AliPHOSDigit", 1000) ;
+
+ TBranch * branch = sdigitTree->GetBranch("PHOS") ;
+ if ( ! branch ) {
+ AliWarning("PHOS branch in SDigit Tree not found") ;
+ } else {
+ branch->SetAddress(&sdigits) ;
+ branch->GetEntry(0) ;
+ MakeSDigits(sdigits) ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQADataMakerSim::StartOfDetectorCycle()
+{
+ //Detector specific actions at start of cycle
+
+}
--- /dev/null
+#ifndef ALIPHOSQADataMakerSim_H
+#define ALIPHOSQADataMakerSim_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+/*
+ Produces the data needed to calculate the quality assurance.
+ All data must be mergeable objects.
+ Y. Schutz CERN July 2007
+*/
+
+
+// --- ROOT system ---
+class TH1F ;
+class TH1I ;
+class TObjArray ;
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliQADataMakerSim.h"
+
+class AliPHOSQADataMakerSim: public AliQADataMakerSim {
+
+public:
+ AliPHOSQADataMakerSim() ; // ctor
+ AliPHOSQADataMakerSim(const AliPHOSQADataMakerSim& qadm) ;
+ AliPHOSQADataMakerSim& operator = (const AliPHOSQADataMakerSim& qadm) ;
+ virtual ~AliPHOSQADataMakerSim() {;} // dtor
+
+private:
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * list) ;
+ virtual void InitHits() ;
+ virtual void InitDigits() ;
+ 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 MakeSDigits(TClonesArray * sigits) ;
+ virtual void MakeSDigits(TTree * sigitTree) ;
+ virtual void StartOfDetectorCycle() ;
+
+ ClassDef(AliPHOSQADataMakerSim,1) // description
+
+};
+
+#endif // AliPHOSQADataMakerSim_H
/* History of cvs commits:
*
* $Log$
+ * Revision 1.56 2007/10/19 18:04:29 schutz
+ * The standalone QA data maker is called from AliSimulation and AliReconstruction outside the event loop; i.e. re-reading the data. The QA data making in the event loop has been commented out.
+ *
* Revision 1.55 2007/10/14 21:08:10 schutz
* Introduced the checking of QA results from previous step before entering the event loop
*
#include "AliPHOSGetter.h"
#include "AliPHOSHit.h"
#include "AliPHOSSDigitizer.h"
-#include "AliPHOSQADataMaker.h"
ClassImp(AliPHOSSDigitizer)
if(strstr(option,"tim"))
gBenchmark->Start("PHOSSDigitizer");
- // check the QA result for RAWS
+/*
+ // check the QA result for RAWS
AliQA * qa = AliQA::Instance(AliQA::kPHOS) ;
if ( qa->IsSet(AliQA::kPHOS, AliQA::kRAW, AliQA::kFATAL)) {
AliFatal("QA status in RAW was Fatal") ;
} else if ( qa->IsSet(AliQA::kPHOS, AliQA::kRAW, AliQA::kINFO) ) {
AliInfo("QA status in RAW was Info") ;
}
-
+*/
AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
//switch off reloading of this task while getting event
/* History of cvs commits:
*
* $Log$
+ * Revision 1.93 2007/10/10 09:05:10 schutz
+ * Changing name QualAss to QA
+ *
* Revision 1.92 2007/08/28 12:55:08 policheh
* Loaders removed from the reconstruction code (C.Cheshkov)
*
#include "AliPHOSLink.h"
#include "AliESDEvent.h"
#include "AliESDtrack.h"
-#include "AliPHOSQADataMaker.h"
#include "AliPHOSEmcRecPoint.h"
#include "AliPHOSCpvRecPoint.h"
/* History of cvs commits:
*
* $Log$
+ * Revision 1.9 2007/10/10 09:05:10 schutz
+ * Changing name QualAss to QA
+ *
* Revision 1.8 2007/08/28 12:55:08 policheh
* Loaders removed from the reconstruction code (C.Cheshkov)
*
#include "AliPHOSTracker.h"
#include "AliPHOSEmcRecPoint.h"
#include "AliESDEvent.h"
-#include "AliPHOSQADataMaker.h"
#include "AliPHOSGetter.h"
#include "AliESDtrack.h"
#include "AliPHOSTrackSegmentMakerv1.h"
#pragma link C++ class AliPHOSSurvey+;
#pragma link C++ class AliPHOSSurvey1+;
-#pragma link C++ class AliPHOSQADataMaker+;
#pragma link C++ class AliPHOSQAChecker+;
#pragma link C++ class AliPHOSRecParticle+;
#pragma link C++ class AliPHOSRecPoint+;
#pragma link C++ class AliPHOSRecoParamEmc+;
#pragma link C++ class AliPHOSRecoParamCpv+;
#pragma link C++ class AliPHOSEsdCluster+;
+#pragma link C++ class AliPHOSQADataMakerRec+;
#endif
#pragma link C++ class AliPHOSConTableDB+;
#pragma link C++ class AliPHOSOnlineMonitor+;
#pragma link C++ class AliPHOSTrigger+;
+#pragma link C++ class AliPHOSQADataMakerSim+;
#endif
AliPHOSEmcBadChannelsMap.cxx \
AliPHOSSurvey.cxx \
AliPHOSSurvey1.cxx \
- AliPHOSQADataMaker.cxx \
AliPHOSQAChecker.cxx \
AliPHOSRecParticle.cxx AliPHOSRecPoint.cxx \
AliPHOSEmcRecPoint.cxx \
AliPHOSRecoParam.cxx \
AliPHOSRecoParamEmc.cxx \
AliPHOSRecoParamCpv.cxx \
- AliPHOSEsdCluster.cxx
+ AliPHOSEsdCluster.cxx \
+ AliPHOSQADataMakerRec.cxx
HDRS:= $(SRCS:.cxx=.h)
AliPHOSCalibrator.cxx AliPHOSCalibrManager.cxx \
AliPHOSConTableDB.cxx \
AliPHOSOnlineMonitor.cxx \
- AliPHOSTrigger.cxx
+ AliPHOSTrigger.cxx \
+ AliPHOSQADataMakerSim.cxx
HDRS:= $(SRCS:.cxx=.h)
AliQADataMaker::fESDsQAList (for keeping global ESD QA data)
*/
-#include "AliQADataMaker.h"
+#include "AliQADataMakerRec.h"
class AliESDEvent;
-class AliGlobalQADataMaker: public AliQADataMaker {
+class AliGlobalQADataMaker: public AliQADataMakerRec {
public:
AliGlobalQADataMaker(const Char_t *name="Global",
const Char_t *title="Global QA data maker"):
- AliQADataMaker(name,title) {;}
- AliGlobalQADataMaker(const AliQADataMaker& qadm):
- AliQADataMaker(qadm) {;}
+ AliQADataMakerRec(name,title) {;}
+ AliGlobalQADataMaker(const AliQADataMakerRec& qadm):
+ AliQADataMakerRec(qadm) {;}
void InitRecPoints();
fOutput(0x0),
fDetectorDir(0x0),
fDetectorDirName(""),
- fDigitsQAList(0x0),
- fESDsQAList(0x0),
- fHitsQAList(0x0),
- fRawsQAList(0x0),
- fRecPointsQAList(0x0),
- fSDigitsQAList(0x0),
fCurrentCycle(-1),
fCycle(9999999),
fCycleCounter(0),
fOutput(qadm.fOutput),
fDetectorDir(qadm.fDetectorDir),
fDetectorDirName(qadm.fDetectorDirName),
- fDigitsQAList(qadm.fDigitsQAList),
- fESDsQAList(qadm.fESDsQAList),
- fHitsQAList(qadm.fHitsQAList),
- fRawsQAList(qadm.fRawsQAList),
- fRecPointsQAList(qadm.fRecPointsQAList),
- fSDigitsQAList(qadm.fSDigitsQAList),
fCurrentCycle(qadm.fCurrentCycle),
fCycle(qadm.fCycle),
fCycleCounter(qadm.fCycleCounter),
fDetectorDirName = GetName() ;
}
-//__________________________________________________________________
-AliQADataMaker& AliQADataMaker::operator = (const AliQADataMaker& qadm )
-{
- // Assignment operator.
- this->~AliQADataMaker();
- new(this) AliQADataMaker(qadm);
- return *this;
-}
-
//____________________________________________________________________________
Int_t AliQADataMaker::Add2List(TH1 * hist, const Int_t index, TObjArray * list)
{
- // Set histograms memory resident and add to the list
- hist->SetDirectory(0) ;
- list->AddAtAndExpand(hist, index) ;
- return list->GetLast() ;
-}
-
-//____________________________________________________________________________
-void AliQADataMaker::EndOfCycle(AliQA::TASKINDEX task)
-{
- // Finishes a cycle of QA data acquistion
-
- TObjArray * list = 0x0 ;
-
- switch (task) {
-
- case AliQA::kRAWS:
- list = fRawsQAList ;
- break ;
-
- case AliQA::kHITS:
- list = fHitsQAList ;
- break ;
-
- case AliQA::kSDIGITS:
- list = fSDigitsQAList ;
- break ;
-
- case AliQA::kDIGITS:
- list = fDigitsQAList ;
- break ;
-
- case AliQA::kRECPOINTS:
- list = fRecPointsQAList ;
- break ;
-
- case AliQA::kTRACKSEGMENTS:
- break ;
-
- case AliQA::kRECPARTICLES:
- break ;
-
- case AliQA::kESDS:
- list = fESDsQAList ;
- break ;
-
- case AliQA::kNTASKINDEX:
- break ;
- }
-
- EndOfDetectorCycle(task, list) ;
- TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
- subDir->cd() ;
- list->Write() ;
-}
-
-//____________________________________________________________________________
-void AliQADataMaker::Exec(AliQA::TASKINDEX task, TObject * data)
-{
- // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
-
- switch (task) {
-
- case AliQA::kRAWS:
- {
- AliDebug(1, "Processing Raws QA") ;
- AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
- if (rawReader)
- MakeRaws(rawReader) ;
- else
- AliError("Wrong data type") ;
- break ;
- }
- case AliQA::kHITS:
- {
- AliDebug(1, "Processing Hits QA") ;
- TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
- if (arr) {
- MakeHits(arr) ;
- } else {
- TTree * tree = dynamic_cast<TTree *>(data) ;
- if (tree) {
- MakeHits(tree) ;
- } else {
- AliWarning("data are neither a TClonesArray nor a TTree") ;
- }
- }
- break ;
- }
- case AliQA::kSDIGITS:
- {
- AliDebug(1, "Processing SDigits QA") ;
- TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
- if (arr) {
- MakeSDigits(arr) ;
- } else {
- TTree * tree = dynamic_cast<TTree *>(data) ;
- if (tree) {
- MakeSDigits(tree) ;
- } else {
- AliWarning("data are neither a TClonesArray nor a TTree") ;
- }
- }
- break ;
- }
- case AliQA::kDIGITS:
- {
- AliDebug(1, "Processing Digits QA") ;
- TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
- if (arr) {
- MakeDigits(arr) ;
- } else {
- TTree * tree = dynamic_cast<TTree *>(data) ;
- if (tree) {
- MakeDigits(tree) ;
- } else {
- AliWarning("data are neither a TClonesArray nor a TTree") ;
- }
- }
- break ;
- }
- case AliQA::kRECPOINTS:
- {
- AliDebug(1, "Processing RecPoints QA") ;
- TTree * tree = dynamic_cast<TTree *>(data) ;
- if (tree) {
- MakeRecPoints(tree) ;
- } else {
- AliWarning("data are not a TTree") ;
- }
- break ;
- }
- case AliQA::kTRACKSEGMENTS:
- AliInfo("Processing Track Segments QA: not existing anymore") ;
- // MakeTrackSegments(ts) ;
- break ;
-
- case AliQA::kRECPARTICLES:
- AliInfo("Processing RecParticles QA: not existing anymore") ;
- // MakeRecParticles(recpar) ;
- break ;
- case AliQA::kESDS:
- {
- AliDebug(1, "Processing ESDs QA") ;
- AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
- if (esd)
- MakeESDs(esd) ;
- else
- AliError("Wrong type of esd container") ;
- break ;
- }
- case AliQA::kNTASKINDEX:
- break ;
- }
+ // Set histograms memory resident and add to the list
+ // Maximm allowed is 100
+ if ( index > 100 ) {
+ AliError("Max number of authorized QA objects is 100") ;
+ return -1 ;
+ } else {
+ hist->SetDirectory(0) ;
+ list->AddAtAndExpand(hist, index) ;
+ return list->GetLast() ;
+ }
}
//____________________________________________________________________________
}
//____________________________________________________________________________
-TObjArray * AliQADataMaker::Init(AliQA::TASKINDEX task, Int_t run, Int_t cycles)
-{
- // general intialisation
-
- fRun = run ;
- if (cycles > 0)
- SetCycle(cycles) ;
-
- switch (task) {
- case AliQA::kRAWS:
- {
- fRawsQAList = new TObjArray(100) ;
- InitRaws() ;
- return fRawsQAList ;
- break ;
- }
- case AliQA::kHITS:
- {
- fHitsQAList = new TObjArray(100) ;
- InitHits() ;
- return fHitsQAList ;
- break ;
- }
- case AliQA::kSDIGITS:
- {
- fSDigitsQAList = new TObjArray(100) ;
- InitSDigits() ;
- return fSDigitsQAList ;
- break ;
- }
- case AliQA::kDIGITS:
- {
- fDigitsQAList = new TObjArray(100);
- InitDigits() ;
- return fDigitsQAList ;
- break ;
- }
- case AliQA::kRECPOINTS:
- {
- fRecPointsQAList = new TObjArray(100) ;
- InitRecPoints() ;
- return fRecPointsQAList ;
- break ;
- }
- case AliQA::kTRACKSEGMENTS:
-// InitTrackSegments() ;
- break ;
-
- case AliQA::kRECPARTICLES:
-// InitRecParticles() ;
- break ;
-
- case AliQA::kESDS:
- {
- fESDsQAList = new TObjArray(100) ;
- InitESDs() ;
- return fESDsQAList ;
- break ;
- }
- case AliQA::kNTASKINDEX:
- break ;
- }
- return 0x0 ;
-}
-
-//____________________________________________________________________________
-void AliQADataMaker::Init(AliQA::TASKINDEX task, TObjArray * list, Int_t run, Int_t cycles)
-{
- // Intialisation by passing the list of QA data booked elsewhere
-
- fRun = run ;
- if (cycles > 0)
- SetCycle(cycles) ;
-
- switch (task) {
- case AliQA::kRAWS:
- {
- fRawsQAList = list ;
- break ;
- }
- case AliQA::kHITS:
- {
- fHitsQAList = list ;
- break ;
- }
- case AliQA::kSDIGITS:
- {
- fSDigitsQAList = list ;
- break ;
- }
- case AliQA::kDIGITS:
- {
- fDigitsQAList = list ;
- break ;
- }
- case AliQA::kRECPOINTS:
- {
- fRecPointsQAList = list ;
- break ;
- }
- case AliQA::kTRACKSEGMENTS:
- break ;
-
- case AliQA::kRECPARTICLES:
- break ;
-
- case AliQA::kESDS:
- {
- fESDsQAList = list ;
- break ;
- }
- case AliQA::kNTASKINDEX:
- break ;
- }
-}
+TObject * AliQADataMaker::GetData(TObjArray * list, const Int_t index)
+{
+ // Returns the QA object at index. Limit is 100.
+ if ( index > 100 ) {
+ AliError("Max number of authorized QA objects is 100") ;
+ return NULL;
+ } else {
+ return list->At(index) ;
+ }
+}
//____________________________________________________________________________
void AliQADataMaker::Reset()
fCurrentCycle = -1 ;
fCycleCounter = 0 ;
}
-
-//____________________________________________________________________________
-void AliQADataMaker::StartOfCycle(AliQA::TASKINDEX task, const Bool_t sameCycle)
-{
- // Finishes a cycle of QA data acquistion
-
- if ( !sameCycle || fCurrentCycle == -1) {
- ResetCycle() ;
- if (fOutput)
- fOutput->Close() ;
- fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
-}
- AliInfo(Form(" Run %d Cycle %d task %s file %s",
- fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
-
- fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
- if (!fDetectorDir)
- fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
-
- TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
- if (!subDir)
- subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
- subDir->cd() ;
-
- TObjArray * list = 0x0 ;
-
- switch (task) {
- case AliQA::kRAWS:
- list = fRawsQAList ;
- break ;
-
- case AliQA::kHITS:
- list = fHitsQAList ;
- break ;
-
- case AliQA::kSDIGITS:
- list = fSDigitsQAList ;
- break ;
-
- case AliQA::kDIGITS:
- list = fDigitsQAList ;
- break ;
-
- case AliQA::kRECPOINTS:
- list = fRecPointsQAList ;
- break ;
-
- case AliQA::kTRACKSEGMENTS:
- break ;
-
- case AliQA::kRECPARTICLES:
- break ;
-
- case AliQA::kESDS:
- list = fESDsQAList ;
- break ;
-
- case AliQA::kNTASKINDEX:
- break ;
-}
-
- TIter next(list) ;
- TH1 * h ;
- while ( (h = dynamic_cast<TH1 *>(next())) )
- h->Reset() ;
-
- StartOfDetectorCycle() ;
-
-}
class AliQADataMaker: public TNamed {
public:
+
+ AliQADataMaker(const char * name="", const char * title="") ; // ctor
+ AliQADataMaker(const AliQADataMaker& qadm) ;
+// AliQADataMaker& operator = (const AliQADataMaker& /*qadm*/) {;}
+ virtual ~AliQADataMaker() {;} // dtor
- AliQADataMaker(const char * name="", const char * title="") ; // ctor
- AliQADataMaker(const AliQADataMaker& qadm) ;
- AliQADataMaker& operator = (const AliQADataMaker& qadm) ;
- virtual ~AliQADataMaker() {;} // dtor
-
- const Int_t Add2DigitsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fDigitsQAList) ; }
- const Int_t Add2ESDsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fESDsQAList) ; }
- const Int_t Add2HitsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fHitsQAList) ; }
- const Int_t Add2RecPointsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fRecPointsQAList) ; }
- const Int_t Add2RawsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fRawsQAList) ; }
- const Int_t Add2SDigitsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fSDigitsQAList) ; }
- virtual void Exec(AliQA::TASKINDEX, TObject * data) ;
- void EndOfCycle(AliQA::TASKINDEX) ;
- void Finish() const ;
- TH1 * GetDigitsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fDigitsQAList, index)) ; }
- TH1 * GetESDsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fESDsQAList, index)) ; }
- TH1 * GetHitsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fHitsQAList, index)) ; }
- TH1 * GetRecPointsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fRecPointsQAList, index)) ; }
- TH1 * GetRawsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fRawsQAList, index)) ; }
- TH1 * GetSDigitsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fSDigitsQAList, index)) ; }
- const char * GetDetectorDirName() { return fDetectorDirName.Data() ; }
- const Int_t Increment() { return ++fCycleCounter ; }
- TObjArray * Init(AliQA::TASKINDEX, Int_t run, Int_t cycles = -1) ;
- void Init(AliQA::TASKINDEX, TObjArray * list, Int_t run, Int_t cycles = -1) ;
- const Bool_t IsCycleDone() const { return fCycleCounter > fCycle ? kTRUE : kFALSE ; }
- void Reset() ;
- void SetCycle(Int_t nevts) { fCycle = nevts ; }
- void StartOfCycle(AliQA::TASKINDEX, const Bool_t sameCycle = kFALSE) ;
+ virtual const Int_t Add2DigitsList(TH1 * hist, const Int_t index) = 0 ;
+ virtual const Int_t Add2ESDsList(TH1 * hist, const Int_t index) = 0 ;
+ virtual const Int_t Add2HitsList(TH1 * hist, const Int_t index) = 0 ;
+ virtual const Int_t Add2RecPointsList(TH1 * hist, const Int_t index) = 0 ;
+ virtual const Int_t Add2RawsList(TH1 * hist, const Int_t index) = 0 ;
+ virtual const Int_t Add2SDigitsList(TH1 * hist, const Int_t index) = 0 ;
+ virtual void Exec(AliQA::TASKINDEX, TObject * data) = 0 ;
+ virtual void EndOfCycle(AliQA::TASKINDEX) = 0 ;
+ void Finish() const ;
+ virtual TH1 * GetDigitsData(const Int_t index) = 0 ;
+ virtual TH1 * GetESDsData(const Int_t index) = 0 ;
+ virtual TH1 * GetHitsData(const Int_t index) = 0 ;
+ virtual TH1 * GetRecPointsData(const Int_t index) = 0 ;
+ virtual TH1 * GetRawsData(const Int_t index) = 0 ;
+ virtual TH1 * GetSDigitsData(const Int_t index) = 0 ;
+ const char * GetDetectorDirName() { return fDetectorDirName.Data() ; }
+ const Int_t Increment() { return ++fCycleCounter ; }
+ virtual TObjArray * Init(AliQA::TASKINDEX, Int_t run, Int_t cycles = -1) = 0 ;
+ virtual void Init(AliQA::TASKINDEX, TObjArray * list, Int_t run, Int_t cycles = -1) = 0 ;
+ const Bool_t IsCycleDone() const { return fCycleCounter > fCycle ? kTRUE : kFALSE ; }
+ void Reset() ;
+ void SetCycle(Int_t nevts) { fCycle = nevts ; }
+ virtual void StartOfCycle(AliQA::TASKINDEX, const Bool_t sameCycle = kFALSE) = 0 ;
protected:
- Int_t Add2List(TH1 * hist, const Int_t index, TObjArray * list) ;
- virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * ) {AliInfo("To be implemented by detectors");}
- TObject * GetData(TObjArray * list, const Int_t index) { return list->At(index) ; }
- virtual void InitDigits() {AliInfo("To be implemented by detectors");}
- virtual void InitESDs() {AliInfo("To be implemented by detectors");}
- virtual void InitHits() {AliInfo("To be implemented by detectors");}
- //virtual void InitRecParticles() {AliInfo("To be implemented by detectors");}
- virtual void InitRecPoints() {AliInfo("To be implemented by detectors");}
- virtual void InitRaws() {AliInfo("To be implemented by detectors");}
- virtual void InitSDigits() {AliInfo("To be implemented by detectors");}
- //virtual void InitTrackSegments() {AliInfo("To ne implemented by detectors");}
- virtual void MakeESDs(AliESDEvent * ) {AliInfo("To be implemented by detectors");}
- virtual void MakeHits(TClonesArray * ) {AliInfo("To be implemented by detectors");}
- virtual void MakeHits(TTree * ) {AliInfo("To be implemented by detectors");}
- virtual void MakeDigits(TClonesArray * ) {AliInfo("To be implemented by detectors");}
- virtual void MakeDigits(TTree * ) {AliInfo("To be implemented by detectors");}
- // virtual void MakeRecParticles(TClonesArray * ) {AliInfo("To be implemented by detectors");}
- virtual void MakeRaws(AliRawReader *) {AliInfo("To be implemented by detectors");}
- virtual void MakeRecPoints(TTree * ) {AliInfo("To be implemented by detectors");}
- virtual void MakeSDigits(TClonesArray * ) {AliInfo("To be implemented by detectors");}
- virtual void MakeSDigits(TTree * ) {AliInfo("To be implemented by detectors");}
- //virtual void MakeTrackSegments(TTree * ) {AliInfo("To be implemented by detectors");}
- void ResetCycle() { fCurrentCycle++ ; fCycleCounter = 0 ; }
- virtual void StartOfDetectorCycle() {AliInfo("To be implemented by detectors");}
-
- TFile * fOutput ; //! output root file
- TDirectory * fDetectorDir ; //! directory for the given detector in the file
- TString fDetectorDirName ; //! detector directory name in the quality assurance data file
- TObjArray * fDigitsQAList ; //! list of the digits QA data objects
- TObjArray * fESDsQAList ; //! list of the ESDs QA data objects
- TObjArray * fHitsQAList ; //! list of the hits QA data objects
- TObjArray * fRawsQAList ; //! list of the raws QA data objects
- TObjArray * fRecPointsQAList ; //! list of the recpoints QA data objects
- TObjArray * fSDigitsQAList ; //! list of the sdigits QA data objects
- Int_t fCurrentCycle ; //! current cycle number
- Int_t fCycle ; //! length (# events) of the QA data acquisition cycle
- Int_t fCycleCounter ; //! cycle counter
- Int_t fRun ; //! run number
+ Int_t Add2List(TH1 * hist, const Int_t index, TObjArray * list) ;
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * ) = 0 ;
+ TObject * GetData(TObjArray * list, const Int_t index) ;
+ virtual void InitDigits() = 0 ;
+ virtual void InitESDs() = 0 ;
+ virtual void InitHits() = 0 ;
+ //virtual void InitRecParticles() = 0 ;
+ virtual void InitRecPoints() = 0 ;
+ virtual void InitRaws() = 0 ;
+ virtual void InitSDigits() = 0 ;
+ //virtual void InitTrackSegments() = 0 ;
+ virtual void MakeESDs(AliESDEvent * ) = 0 ;
+ virtual void MakeHits(TClonesArray * ) = 0 ;
+ virtual void MakeHits(TTree * ) = 0 ;
+ virtual void MakeDigits(TClonesArray * ) = 0 ;
+ virtual void MakeDigits(TTree * ) = 0 ;
+ //virtual void MakeRecParticles(TClonesArray * ) = 0 ;
+ virtual void MakeRaws(AliRawReader *) = 0 ;
+ virtual void MakeRecPoints(TTree * ) = 0 ;
+ virtual void MakeSDigits(TClonesArray * ) = 0 ;
+ virtual void MakeSDigits(TTree * ) = 0 ;
+ //virtual void MakeTrackSegments(TTree * ) = 0 ;
+ void ResetCycle() { fCurrentCycle++ ; fCycleCounter = 0 ; }
+ virtual void StartOfDetectorCycle() = 0 ;
+
+ TFile * fOutput ; //! output root file
+ TDirectory * fDetectorDir ; //! directory for the given detector in the file
+ TString fDetectorDirName ; //! detector directory name in the quality assurance data file
+ Int_t fCurrentCycle ; //! current cycle number
+ Int_t fCycle ; //! length (# events) of the QA data acquisition cycle
+ Int_t fCycleCounter ; //! cycle counter
+ Int_t fRun ; //! run number
ClassDef(AliQADataMaker,1) // description
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+
+/* $Id$ */
+
+/*
+ Base Class
+ Produces the data needed to calculate the quality assurance for Reconstruction
+ All data must be mergeable objects.
+ Y. Schutz CERN July 2007
+*/
+
+// --- ROOT system ---
+#include <TSystem.h>
+#include <TFile.h>
+#include <TList.h>
+#include <TTree.h>
+#include <TClonesArray.h>
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliLog.h"
+#include "AliQADataMakerRec.h"
+#include "AliQAChecker.h"
+#include "AliESDEvent.h"
+#include "AliRawReader.h"
+
+ClassImp(AliQADataMakerRec)
+
+//____________________________________________________________________________
+AliQADataMakerRec::AliQADataMakerRec(const char * name, const char * title) :
+ AliQADataMaker(name, title),
+ fESDsQAList(0x0),
+ fRawsQAList(0x0),
+ fRecPointsQAList(0x0)
+{
+ // ctor
+ fDetectorDirName = GetName() ;
+}
+
+//____________________________________________________________________________
+AliQADataMakerRec::AliQADataMakerRec(const AliQADataMakerRec& qadm) :
+ AliQADataMaker(qadm.GetName(), qadm.GetTitle()),
+ fESDsQAList(qadm.fESDsQAList),
+ fRawsQAList(qadm.fRawsQAList),
+ fRecPointsQAList(qadm.fRecPointsQAList)
+
+{
+ //copy ctor
+ SetName(qadm.GetName()) ;
+ SetTitle(qadm.GetTitle()) ;
+ fDetectorDirName = GetName() ;
+}
+
+//__________________________________________________________________
+AliQADataMakerRec& AliQADataMakerRec::operator = (const AliQADataMakerRec& qadm )
+{
+ // Assignment operator.
+ this->~AliQADataMakerRec();
+ new(this) AliQADataMakerRec(qadm);
+ return *this;
+}
+
+//____________________________________________________________________________
+void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX task)
+{
+ // Finishes a cycle of QA data acquistion
+
+ TObjArray * list = 0x0 ;
+
+ if ( task == AliQA::kRAWS )
+ list = fRawsQAList ;
+ else if ( task == AliQA::kRECPOINTS )
+ list = fRecPointsQAList ;
+ else if ( task == AliQA::kESDS )
+ list = fESDsQAList ;
+
+ EndOfDetectorCycle(task, list) ;
+ TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
+ subDir->cd() ;
+ list->Write() ;
+}
+
+//____________________________________________________________________________
+void AliQADataMakerRec::Exec(AliQA::TASKINDEX task, TObject * data)
+{
+ // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
+
+ if ( task == AliQA::kRAWS ) {
+ AliDebug(1, "Processing Raws QA") ;
+ AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
+ if (rawReader)
+ MakeRaws(rawReader) ;
+ else
+ AliError("Wrong data type") ;
+ } else if ( task == AliQA::kRECPOINTS ) {
+ AliDebug(1, "Processing RecPoints QA") ;
+ TTree * tree = dynamic_cast<TTree *>(data) ;
+ if (tree) {
+ MakeRecPoints(tree) ;
+ } else {
+ AliWarning("data are not a TTree") ;
+ }
+ } else if ( task == AliQA::kESDS ) {
+ AliDebug(1, "Processing ESDs QA") ;
+ AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
+ if (esd)
+ MakeESDs(esd) ;
+ else
+ AliError("Wrong type of esd container") ;
+ }
+}
+
+//____________________________________________________________________________
+TObjArray * AliQADataMakerRec::Init(AliQA::TASKINDEX task, Int_t run, Int_t cycles)
+{
+ // general intialisation
+
+ TObjArray * rv = NULL ;
+
+ fRun = run ;
+ if (cycles > 0)
+ SetCycle(cycles) ;
+
+ if ( task == AliQA::kRAWS ) {
+ fRawsQAList = new TObjArray(100) ;
+ InitRaws() ;
+ rv = fRawsQAList ;
+ } else if ( task == AliQA::kRECPOINTS ) {
+ fRecPointsQAList = new TObjArray(100) ;
+ InitRecPoints() ;
+ rv = fRecPointsQAList ;
+ } else if ( task == AliQA::kESDS ) {
+ fESDsQAList = new TObjArray(100) ;
+ InitESDs() ;
+ rv = fESDsQAList ;
+ }
+
+ return rv ;
+}
+
+//____________________________________________________________________________
+void AliQADataMakerRec::Init(AliQA::TASKINDEX task, TObjArray * list, Int_t run, Int_t cycles)
+{
+ // Intialisation by passing the list of QA data booked elsewhere
+
+ fRun = run ;
+ if (cycles > 0)
+ SetCycle(cycles) ;
+
+ if ( task == AliQA::kRAWS ) {
+ fRawsQAList = list ;
+ } else if ( task == AliQA::kRECPOINTS ) {
+ fRecPointsQAList = list ;
+ } else if ( task == AliQA::kESDS ) {
+ fESDsQAList = list ;
+ }
+}
+
+//____________________________________________________________________________
+void AliQADataMakerRec::StartOfCycle(AliQA::TASKINDEX task, const Bool_t sameCycle)
+{
+ // Finishes a cycle of QA data acquistion
+
+ if ( !sameCycle || fCurrentCycle == -1) {
+ ResetCycle() ;
+ if (fOutput)
+ fOutput->Close() ;
+ fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
+ }
+ AliInfo(Form(" Run %d Cycle %d task %s file %s",
+ fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
+
+ fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
+ if (!fDetectorDir)
+ fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
+
+ TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
+ if (!subDir)
+ subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
+ subDir->cd() ;
+
+ TObjArray * list = 0x0 ;
+
+ if ( task == AliQA::kRAWS )
+ list = fRawsQAList ;
+ else if ( task == AliQA::kRECPOINTS)
+ list = fRecPointsQAList ;
+ else if ( task == AliQA::kESDS )
+ list = fESDsQAList ;
+
+ TIter next(list) ;
+ TH1 * h ;
+ while ( (h = dynamic_cast<TH1 *>(next())) )
+ h->Reset() ;
+
+ StartOfDetectorCycle() ;
+}
--- /dev/null
+#ifndef AliQADataMakerREC_H
+#define AliQADataMakerREC_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+/*
+ Base Class:
+ Produces the data needed to calculate the quality assurance.
+ All data must be mergeable objects.
+ Y. Schutz CERN July 2007
+*/
+
+
+// --- ROOT system ---
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliQADataMaker.h"
+
+class AliQADataMakerRec: public AliQADataMaker {
+
+public:
+
+ AliQADataMakerRec(const char * name="", const char * title="") ; // ctor
+ AliQADataMakerRec(const AliQADataMakerRec& qadm) ;
+ AliQADataMakerRec& operator = (const AliQADataMakerRec& qadm) ;
+ virtual ~AliQADataMakerRec() {;} // dtor
+
+ virtual const Int_t Add2DigitsList(TH1 * /*hist*/, const Int_t /*index*/) { return -1 ; }
+ virtual const Int_t Add2ESDsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fESDsQAList) ; }
+ virtual const Int_t Add2HitsList(TH1 * /*hist*/, const Int_t /*index*/) { return -1 ; }
+ virtual const Int_t Add2RecPointsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fRecPointsQAList) ; }
+ virtual const Int_t Add2RawsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fRawsQAList) ; }
+ virtual const Int_t Add2SDigitsList(TH1 * /*hist*/, const Int_t /*index*/) { return -1 ; }
+ virtual void Exec(AliQA::TASKINDEX, TObject * data) ;
+ virtual void EndOfCycle(AliQA::TASKINDEX) ;
+ virtual TH1 * GetDigitsData(const Int_t /*index*/) { return NULL ; }
+ virtual TH1 * GetESDsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fESDsQAList, index)) ; }
+ virtual TH1 * GetHitsData(const Int_t /*index*/) { return NULL ; }
+ virtual TH1 * GetRecPointsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fRecPointsQAList, index)) ; }
+ virtual TH1 * GetRawsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fRawsQAList, index)) ; }
+ virtual TH1 * GetSDigitsData(const Int_t /*index*/) { return NULL ; }
+ virtual TObjArray * Init(AliQA::TASKINDEX, Int_t run, Int_t cycles = -1) ;
+ virtual void Init(AliQA::TASKINDEX, TObjArray * list, Int_t run, Int_t cycles = -1) ;
+ virtual void StartOfCycle(AliQA::TASKINDEX, const Bool_t sameCycle = kFALSE) ;
+
+protected:
+
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * ) {AliInfo("To be implemented by detectors");}
+ virtual void InitDigits() {AliFatal("Call not valid") ; }
+ virtual void InitESDs() {AliInfo("To be implemented by detectors");}
+ virtual void InitHits() {AliFatal("Call not valid") ; }
+ //virtual void InitRecParticles() {AliInfo("To be implemented by detectors");}
+ virtual void InitRecPoints() {AliInfo("To be implemented by detectors");}
+ virtual void InitRaws() {AliInfo("To be implemented by detectors");}
+ virtual void InitSDigits() {AliFatal("Call not valid") ; }
+ //virtual void InitTrackSegments() {AliInfo("To ne implemented by detectors");}
+ virtual void MakeESDs(AliESDEvent * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeHits(TClonesArray * ) {AliFatal("Call not valid") ; }
+ virtual void MakeHits(TTree * ) {AliFatal("Call not valid") ; }
+ virtual void MakeDigits(TClonesArray * ) {AliFatal("Call not valid") ; }
+ virtual void MakeDigits(TTree * ) {AliFatal("Call not valid") ; }
+ //virtual void MakeRecParticles(TClonesArray * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeRaws(AliRawReader *) {AliInfo("To be implemented by detectors");}
+ virtual void MakeRecPoints(TTree * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeSDigits(TClonesArray * ) {AliFatal("Call not valid") ; }
+ virtual void MakeSDigits(TTree * ) {AliFatal("Call not valid") ; }
+ virtual void StartOfDetectorCycle() {AliInfo("To be implemented by detectors");}
+
+ TObjArray * fESDsQAList ; //! list of the ESDs QA data objects
+ TObjArray * fRawsQAList ; //! list of the raws QA data objects
+ TObjArray * fRecPointsQAList ; //! list of the RecPoints QA data objects
+
+ ClassDef(AliQADataMakerRec,1) // description
+
+};
+
+#endif // AliQADataMakerRec_H
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+
+/* $Id$ */
+
+/*
+ Base Class
+ Produces the data needed to calculate the quality assurance.
+ All data must be mergeable objects.
+ Y. Schutz CERN July 2007
+*/
+
+// --- ROOT system ---
+#include <TSystem.h>
+#include <TFile.h>
+#include <TList.h>
+#include <TTree.h>
+#include <TClonesArray.h>
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliLog.h"
+#include "AliQADataMakerSim.h"
+#include "AliQAChecker.h"
+
+ClassImp(AliQADataMakerSim)
+
+//____________________________________________________________________________
+AliQADataMakerSim::AliQADataMakerSim(const char * name, const char * title) :
+ AliQADataMaker(name, title),
+ fDigitsQAList(0x0),
+ fHitsQAList(0x0),
+ fSDigitsQAList(0x0)
+{
+ // ctor
+ fDetectorDirName = GetName() ;
+}
+
+//____________________________________________________________________________
+AliQADataMakerSim::AliQADataMakerSim(const AliQADataMakerSim& qadm) :
+ AliQADataMaker(qadm.GetName(), qadm.GetTitle()),
+ fDigitsQAList(qadm.fDigitsQAList),
+ fHitsQAList(qadm.fHitsQAList),
+ fSDigitsQAList(qadm.fSDigitsQAList)
+{
+ //copy ctor
+ fDetectorDirName = GetName() ;
+}
+
+//__________________________________________________________________
+AliQADataMakerSim& AliQADataMakerSim::operator = (const AliQADataMakerSim& qadm )
+{
+ // Assignment operator.
+ this->~AliQADataMakerSim();
+ new(this) AliQADataMakerSim(qadm);
+ return *this;
+}
+
+//____________________________________________________________________________
+void AliQADataMakerSim::EndOfCycle(AliQA::TASKINDEX task)
+{
+ // Finishes a cycle of QA data acquistion
+ TObjArray * list = 0x0 ;
+
+ if ( task == AliQA::kHITS )
+ list = fHitsQAList ;
+ else if ( task == AliQA::kSDIGITS )
+ list = fSDigitsQAList ;
+ else if ( task == AliQA::kDIGITS )
+ list = fDigitsQAList ;
+
+ EndOfDetectorCycle(task, list) ;
+ TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
+ subDir->cd() ;
+ list->Write() ;
+}
+
+//____________________________________________________________________________
+void AliQADataMakerSim::Exec(AliQA::TASKINDEX task, TObject * data)
+{
+ // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
+
+ if ( task == AliQA::kHITS ) {
+ AliDebug(1, "Processing Hits QA") ;
+ TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
+ if (arr) {
+ MakeHits(arr) ;
+ } else {
+ TTree * tree = dynamic_cast<TTree *>(data) ;
+ if (tree) {
+ MakeHits(tree) ;
+ } else {
+ AliWarning("data are neither a TClonesArray nor a TTree") ;
+ }
+ }
+ } else if ( task == AliQA::kSDIGITS ) {
+ AliDebug(1, "Processing SDigits QA") ;
+ TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
+ if (arr) {
+ MakeSDigits(arr) ;
+ } else {
+ TTree * tree = dynamic_cast<TTree *>(data) ;
+ if (tree) {
+ MakeSDigits(tree) ;
+ } else {
+ AliWarning("data are neither a TClonesArray nor a TTree") ;
+ }
+ }
+ } else if ( task == AliQA::kDIGITS ) {
+ AliDebug(1, "Processing Digits QA") ;
+ TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
+ if (arr) {
+ MakeDigits(arr) ;
+ } else {
+ TTree * tree = dynamic_cast<TTree *>(data) ;
+ if (tree) {
+ MakeDigits(tree) ;
+ } else {
+ AliWarning("data are neither a TClonesArray nor a TTree") ;
+ }
+ }
+ }
+}
+
+//____________________________________________________________________________
+TObjArray * AliQADataMakerSim::Init(AliQA::TASKINDEX task, Int_t run, Int_t cycles)
+{
+ // general intialisation
+
+ fRun = run ;
+ if (cycles > 0)
+ SetCycle(cycles) ;
+ TObjArray * rv = NULL ;
+ if ( task == AliQA::kHITS ) {
+ fHitsQAList = new TObjArray(100) ;
+ InitHits() ;
+ rv = fHitsQAList ;
+ } else if ( task == AliQA::kSDIGITS ) {
+ fSDigitsQAList = new TObjArray(100) ;
+ InitSDigits() ;
+ rv = fSDigitsQAList ;
+ } else if ( task == AliQA::kDIGITS ) {
+ fDigitsQAList = new TObjArray(100);
+ InitDigits() ;
+ rv = fDigitsQAList ;
+ }
+
+ return rv ;
+}
+
+//____________________________________________________________________________
+void AliQADataMakerSim::Init(AliQA::TASKINDEX task, TObjArray * list, Int_t run, Int_t cycles)
+{
+ // Intialisation by passing the list of QA data booked elsewhere
+
+ fRun = run ;
+ if (cycles > 0)
+ SetCycle(cycles) ;
+
+ if ( task == AliQA::kHITS ) {
+ fHitsQAList = list ;
+ } else if ( task == AliQA::kSDIGITS) {
+ fSDigitsQAList = list ;
+ } else if ( task == AliQA::kDIGITS ) {
+ fDigitsQAList = list ;
+ }
+}
+
+//____________________________________________________________________________
+void AliQADataMakerSim::StartOfCycle(AliQA::TASKINDEX task, const Bool_t sameCycle)
+{
+ // Finishes a cycle of QA data acquistion
+ if ( !sameCycle || fCurrentCycle == -1) {
+ ResetCycle() ;
+ if (fOutput)
+ fOutput->Close() ;
+ fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
+ }
+
+ AliInfo(Form(" Run %d Cycle %d task %s file %s",
+ fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
+
+ fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
+ if (!fDetectorDir)
+ fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
+
+ TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
+ if (!subDir)
+ subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
+ subDir->cd() ;
+
+ TObjArray * list = 0x0 ;
+
+ if ( task == AliQA::kHITS )
+ list = fHitsQAList ;
+ else if ( task == AliQA::kSDIGITS )
+ list = fSDigitsQAList ;
+ else if ( task == AliQA::kDIGITS )
+ list = fDigitsQAList ;
+
+ TIter next(list) ;
+ TH1 * h ;
+ while ( (h = dynamic_cast<TH1 *>(next())) )
+ h->Reset() ;
+
+ StartOfDetectorCycle() ;
+}
--- /dev/null
+#ifndef AliQADataMakerSimSIM_H
+#define AliQADataMakerSimSIM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+/*
+ Base Class:
+ Produces the data needed to calculate the quality assurance.
+ All data must be mergeable objects.
+ Y. Schutz CERN July 2007
+*/
+
+
+// --- ROOT system ---
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliQADataMaker.h"
+
+class AliQADataMakerSim: public AliQADataMaker {
+
+public:
+
+ AliQADataMakerSim(const char * name="", const char * title="") ; // ctor
+ AliQADataMakerSim(const AliQADataMakerSim& qadm) ;
+ AliQADataMakerSim& operator = (const AliQADataMakerSim& qadm) ;
+ virtual ~AliQADataMakerSim() {;} // dtor
+
+ virtual const Int_t Add2DigitsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fDigitsQAList) ; }
+ virtual const Int_t Add2ESDsList(TH1 * /*hist*/, const Int_t /*index*/) { return -1 ; }
+ virtual const Int_t Add2HitsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fHitsQAList) ; }
+ virtual const Int_t Add2RecPointsList(TH1 * /*hist*/, const Int_t /*index*/) { return -1 ; }
+ virtual const Int_t Add2RawsList(TH1 * /*hist*/, const Int_t /*index*/) { return -1 ; }
+ virtual const Int_t Add2SDigitsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fSDigitsQAList) ; }
+ virtual void Exec(AliQA::TASKINDEX, TObject * data) ;
+ virtual void EndOfCycle(AliQA::TASKINDEX) ;
+ virtual TH1 * GetDigitsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fDigitsQAList, index)) ; }
+ virtual TH1 * GetESDsData(const Int_t /*index*/) { return NULL ; }
+ virtual TH1 * GetHitsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fHitsQAList, index)) ; }
+ virtual TH1 * GetRecPointsData(const Int_t /*index*/) { return NULL ; }
+ virtual TH1 * GetRawsData(const Int_t /*index*/) { return NULL ; }
+ virtual TH1 * GetSDigitsData(const Int_t index) { return dynamic_cast<TH1 *>(GetData(fSDigitsQAList, index)) ; }
+ virtual TObjArray * Init(AliQA::TASKINDEX, Int_t run, Int_t cycles = -1) ;
+ virtual void Init(AliQA::TASKINDEX, TObjArray * list, Int_t run, Int_t cycles = -1) ;
+ virtual void StartOfCycle(AliQA::TASKINDEX, const Bool_t sameCycle = kFALSE) ;
+
+protected:
+
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * ) {AliInfo("To be implemented by detectors");}
+ virtual void InitDigits() {AliInfo("To be implemented by detectors");}
+ virtual void InitESDs() {AliFatal("Call not valid") ; }
+ virtual void InitHits() {AliInfo("To be implemented by detectors");}
+ virtual void InitRecPoints() {AliFatal("Call not valid") ; }
+ virtual void InitRaws() {AliFatal("Call not valid") ; }
+ virtual void InitSDigits() {AliInfo("To be implemented by detectors");}
+ virtual void MakeESDs(AliESDEvent * ) {AliFatal("Call not valid") ; }
+ virtual void MakeHits(TClonesArray * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeHits(TTree * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeDigits(TClonesArray * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeDigits(TTree * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeRaws(AliRawReader *) {AliFatal("Call not valid") ; }
+ virtual void MakeRecPoints(TTree * ) {AliFatal("Call not valid") ; }
+ virtual void MakeSDigits(TClonesArray * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeSDigits(TTree * ) {AliInfo("To be implemented by detectors");}
+ virtual void StartOfDetectorCycle() {AliInfo("To be implemented by detectors");}
+
+ TObjArray * fDigitsQAList ; //! list of the digits QA data objects
+ TObjArray * fHitsQAList ; //! list of the hits QA data objects
+ TObjArray * fSDigitsQAList ; //! list of the sdigits QA data objects
+
+ ClassDef(AliQADataMakerSim,1) // description
+
+};
+
+#endif // AliQADataMakerSim_H
#include "AliLog.h"
#include "AliModule.h"
#include "AliQA.h"
-#include "AliQADataMaker.h"
+#include "AliQADataMakerRec.h"
+#include "AliQADataMakerSim.h"
#include "AliQADataMakerSteer.h"
#include "AliRawReaderDate.h"
#include "AliRawReaderFile.h"
}
//_____________________________________________________________________________
-Bool_t AliQADataMakerSteer::DoIt(const AliQA::TASKINDEX taskIndex)
+Bool_t AliQADataMakerSteer::DoIt(const AliQA::TASKINDEX taskIndex, const char * mode)
{
// Runs all the QA data Maker for every detector
Bool_t rv = kFALSE ;
}
if (!IsSelected(AliQA::GetDetName(iDet)))
continue ;
- AliQADataMaker * qadm = GetQADataMaker(iDet) ;
+ AliQADataMaker * qadm = GetQADataMaker(iDet, mode) ;
if (!qadm) {
rv = kFALSE ;
} else {
} // detector loop
} // event loop
// Save QA data for all detectors
- rv = Finish(taskIndex) ;
+ rv = Finish(taskIndex, mode) ;
return rv ;
}
//_____________________________________________________________________________
-Bool_t AliQADataMakerSteer::Finish(const AliQA::TASKINDEX taskIndex)
+Bool_t AliQADataMakerSteer::Finish(const AliQA::TASKINDEX taskIndex, const char * mode)
{
// write output to file for all detectors
for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
if (IsSelected(AliQA::GetDetName(iDet))) {
- AliQADataMaker * qadm = GetQADataMaker(iDet) ;
+ AliQADataMaker * qadm = GetQADataMaker(iDet, mode) ;
if (qadm) {
qadm->EndOfCycle(taskIndex) ;
}
}
//_____________________________________________________________________________
-AliQADataMaker * AliQADataMakerSteer::GetQADataMaker(Int_t iDet)
+AliQADataMaker * AliQADataMakerSteer::GetQADataMaker(const Int_t iDet, const char * mode )
{
// get the quality assurance data maker for a detector
// load the QA data maker object
TPluginManager* pluginManager = gROOT->GetPluginManager() ;
TString detName = AliQA::GetDetName(iDet) ;
- TString qadmName = "Ali" + detName + "QADataMaker" ;
+ TString qadmName = "Ali" + detName + "QADataMaker" + mode ;
// first check if a plugin is defined for the quality assurance data maker
TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName) ;
if (!pluginHandler) {
AliDebug(1, Form("defining plugin for %s", qadmName.Data())) ;
TString libs = gSystem->GetLibraries() ;
- if (libs.Contains("lib" + detName + "base.so") || (gSystem->Load("lib" + detName + "base.so") >= 0)) {
+ if (libs.Contains("lib" + detName + mode + ".so") || (gSystem->Load("lib" + detName + mode + ".so") >= 0)) {
pluginManager->AddHandler("AliQADataMaker", detName, qadmName, detName + "qadm", qadmName + "()") ;
} else {
pluginManager->AddHandler("AliQADataMaker", detName, qadmName, detName, qadmName + "()") ;
}
//_____________________________________________________________________________
-Bool_t AliQADataMakerSteer::Init(const AliQA::TASKINDEX taskIndex, const char * input )
+Bool_t AliQADataMakerSteer::Init(const AliQA::TASKINDEX taskIndex, const char * mode, const char * input )
{
// Initialize the event source and QA data makers
}
if ( ! fRawReader )
return kFALSE ;
+ fRawReaderDelete = kFALSE ;
fRawReader->NextEvent() ;
fRunNumber = fRawReader->GetRunNumber() ;
+ AliCDBManager::Instance()->SetRun(fRunNumber) ;
fRawReader->RewindEvents();
fNumberOfEvents = 999999 ;
} else if (taskIndex == AliQA::kESDS) {
if (!gSystem->AccessPathName("AliESDs.root")) { // AliESDs.root exists
TFile * esdFile = TFile::Open("AliESDs.root") ;
fESDTree = dynamic_cast<TTree *> (esdFile->Get("esdTree")) ;
- fESD = new AliESDEvent() ;
- fESD->ReadFromTree(fESDTree) ;
- fESDTree->GetEntry(0) ;
- fRunNumber = fESD->GetRunNumber() ;
- fNumberOfEvents = fESDTree->GetEntries() ;
+ if ( !fESDTree ) {
+ AliError("esdTree not found") ;
+ return kFALSE ;
+ } else {
+ fESD = new AliESDEvent() ;
+ fESD->ReadFromTree(fESDTree) ;
+ fESDTree->GetEntry(0) ;
+ fRunNumber = fESD->GetRunNumber() ;
+ fNumberOfEvents = fESDTree->GetEntries() ;
+ }
} else {
AliError("AliESDs.root not found") ;
return kFALSE ;
// Initialize all QA data makers for all detectors
for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
if (IsSelected(AliQA::GetDetName(iDet))) {
- AliQADataMaker * qadm = GetQADataMaker(iDet) ;
+ AliQADataMaker * qadm = GetQADataMaker(iDet, mode) ;
if (!qadm) {
AliWarning(Form("AliQADataMaker not found for %s", AliQA::GetDetName(iDet))) ;
} else {
return kTRUE ;
}
-//_____________________________________________________________________________
-Bool_t AliQADataMakerSteer::IsSelected(const char * det)
-{
- // check whether detName is contained in detectors
- // if yes, it is removed from detectors
-
- const TString detName(det) ;
- // check if all detectors are selected
- if ((fDetectors.CompareTo("ALL") == 0) ||
- fDetectors.BeginsWith("ALL ") ||
- fDetectors.EndsWith(" ALL") ||
- fDetectors.Contains(" ALL ")) {
- fDetectors = "ALL";
- return kTRUE;
- }
-
- // search for the given detector
- Bool_t rv = kFALSE;
- if ((fDetectors.CompareTo(detName) == 0) ||
- fDetectors.BeginsWith(detName+" ") ||
- fDetectors.EndsWith(" "+detName) ||
- fDetectors.Contains(" "+detName+" ")) {
-// fDetectors.ReplaceAll(detName, "");
- rv = kTRUE;
- }
-
- // clean up the detectors string
-// while (fDetectors.Contains(" "))
-// fDetectors.ReplaceAll(" ", " ");
-// while (fDetectors.BeginsWith(" "))
-// fDetectors.Remove(0, 1);
-// while (fDetectors.EndsWith(" "))
-// fDetectors.Remove(fDetectors.Length()-1, 1);
-
- return rv ;
-}
-
//_____________________________________________________________________________
Bool_t AliQADataMakerSteer::InitRunLoader()
{
return kTRUE;
}
+//_____________________________________________________________________________
+Bool_t AliQADataMakerSteer::IsSelected(const char * det)
+{
+ // check whether detName is contained in detectors
+ // if yes, it is removed from detectors
+
+ const TString detName(det) ;
+ // check if all detectors are selected
+ if ((fDetectors.CompareTo("ALL") == 0) ||
+ fDetectors.BeginsWith("ALL ") ||
+ fDetectors.EndsWith(" ALL") ||
+ fDetectors.Contains(" ALL ")) {
+ fDetectors = "ALL";
+ return kTRUE;
+ }
+
+ // search for the given detector
+ Bool_t rv = kFALSE;
+ if ((fDetectors.CompareTo(detName) == 0) ||
+ fDetectors.BeginsWith(detName+" ") ||
+ fDetectors.EndsWith(" "+detName) ||
+ fDetectors.Contains(" "+detName+" ")) {
+ // fDetectors.ReplaceAll(detName, "");
+ rv = kTRUE;
+ }
+
+ // clean up the detectors string
+ // while (fDetectors.Contains(" "))
+ // fDetectors.ReplaceAll(" ", " ");
+ // while (fDetectors.BeginsWith(" "))
+ // fDetectors.Remove(0, 1);
+ // while (fDetectors.EndsWith(" "))
+ // fDetectors.Remove(fDetectors.Length()-1, 1);
+
+ return rv ;
+}
+
//_____________________________________________________________________________
Bool_t AliQADataMakerSteer::Merge(const Int_t runNumber) const
{
// Initialize all QA data makers for all detectors
for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
if (IsSelected(AliQA::GetDetName(iDet))) {
- AliQADataMaker * qadm = GetQADataMaker(iDet) ;
+ AliQADataMaker * qadm = GetQADataMaker(iDet, "Rec") ;
if (!qadm) {
AliWarning(Form("AliQADataMaker not found for %s", AliQA::GetDetName(iDet))) ;
} else {
}
fFirst = kFALSE ;
- return DoIt(AliQA::kRAWS) ;
+ return DoIt(AliQA::kRAWS, "Rec") ;
+}
+
+//_____________________________________________________________________________
+Bool_t AliQADataMakerSteer::Run(const char * detectors, const char * fileName)
+{
+ //Runs all the QA data Maker for Raws only
+ fCycleSame = kTRUE ;
+ fDetectors = detectors ;
+
+ if ( !Init(AliQA::kRAWS, "Rec", fileName) )
+ return kFALSE ;
+
+ // Initialize all QA data makers for all detectors
+ for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
+ if (IsSelected(AliQA::GetDetName(iDet))) {
+ AliQADataMaker * qadm = GetQADataMaker(iDet, "Rec") ;
+ if (!qadm) {
+ AliWarning(Form("AliQADataMaker not found for %s", AliQA::GetDetName(iDet))) ;
+ } else {
+ AliInfo(Form("Data Maker found for %s", qadm->GetName())) ;
+ qadm->Init(AliQA::kRAWS, fRunNumber, GetQACycles(iDet)) ;
+ qadm->StartOfCycle(AliQA::kRAWS, fCycleSame) ;
+ }
+ }
+ }
+ fFirst = kFALSE ;
+
+ return DoIt(AliQA::kRAWS, "Rec") ;
}
//_____________________________________________________________________________
Bool_t rv = kFALSE ;
fDetectors = detectors ;
+
+ char * mode ;
+ if ( (taskIndex == AliQA::kHITS) || (taskIndex == AliQA::kSDIGITS) || (taskIndex == AliQA::kDIGITS) )
+ mode = "Sim" ;
+ else if ( (taskIndex == AliQA::kRAWS) || (taskIndex == AliQA::kRECPOINTS) || (taskIndex == AliQA::kESDS) )
+ mode = "Rec" ;
+ else {
+ AliError(Form("%s not implemented", AliQA::GetTaskName(taskIndex).Data())) ;
+ return rv ;
+ }
- if ( !Init(taskIndex, fileName) )
+ if ( !Init(taskIndex, mode, fileName) )
return kFALSE ;
-
- rv = DoIt(taskIndex) ;
+
+ rv = DoIt(taskIndex, mode) ;
return rv ;
man->SetDefaultStorage(AliQA::GetQARefDefaultStorage()) ;
man->SetSpecificStorage(Form("%s/*", AliQA::GetQAOCDBDirName()), AliQA::GetQARefStorage()) ;
}
+ if(man->GetRun() < 0)
+ man->SetRun(runNumber);
+
for ( Int_t detIndex = 0 ; detIndex < AliQA::kNDET ; detIndex++) {
TDirectory * detDir = inputFile->GetDirectory(AliQA::GetDetName(detIndex)) ;
if ( detDir ) {
void Reset() ;
Bool_t Run(const char * detectors, const AliQA::TASKINDEX taskIndex, const char * fileName = NULL) ;
Bool_t Run(const char * detectors, AliRawReader * rawReader) ;
+ Bool_t Run(const char * detectors, const char * filename) ;
Bool_t Save2OCDB(const Int_t runNumber, const Int_t cycleNumber, const char * detectors = "ALL") const ;
void SetCycleLength(const AliQA::DETECTORINDEX det, const Int_t cycle) { fQACycles[det] = cycle ; }
void SetRunLoader(AliRunLoader * rl) { fRunLoader = rl ; }
private:
- Bool_t DoIt(const AliQA::TASKINDEX taskIndex) ;
+ Bool_t DoIt(const AliQA::TASKINDEX taskIndex, const char * mode) ;
AliLoader * GetLoader(Int_t iDet) ;
const Int_t GetQACycles(const Int_t iDet) { return fQACycles[iDet] ; }
- AliQADataMaker * GetQADataMaker(Int_t iDet) ;
- Bool_t Init(const AliQA::TASKINDEX taskIndex, const char * fileName = NULL) ;
+ AliQADataMaker * GetQADataMaker(const Int_t iDet, const char * mode) ;
+ Bool_t Init(const AliQA::TASKINDEX taskIndex, const char * mode, const char * fileName = NULL) ;
Bool_t InitRunLoader() ;
Bool_t IsSelected(const char * detName) ;
- Bool_t Finish(const AliQA::TASKINDEX taskIndex) ;
+ Bool_t Finish(const AliQA::TASKINDEX taskIndex, const char * mode) ;
Bool_t SaveIt2OCDB(const Int_t runNumber, TFile * inputFile) const ;
#include "AliAODFmdCluster.h"
#include "AliAODTracklets.h"
-#include "AliQADataMaker.h"
+#include "AliQADataMakerRec.h"
#include "AliGlobalQADataMaker.h"
#include "AliQA.h"
#include "AliQADataMakerSteer.h"
//QA
AliQADataMakerSteer qas ;
if (fRunQA && fRawReader) qas.Run(fRunLocalReconstruction, fRawReader) ;
-
// checking the QA of previous steps
- CheckQA() ;
+ //CheckQA() ;
/*
// local reconstruction
TString detStr(fFillESD);
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
- AliQADataMaker *qadm = GetQADataMaker(iDet);
+ AliQADataMakerRec *qadm = GetQADataMaker(iDet);
if (!qadm) continue;
AliInfo(Form("Initializing the QA data maker for %s",
fgkDetectorName[iDet]));
}
}
if (fRunGlobalQA) {
- AliQADataMaker *qadm = GetQADataMaker(fgkNDetectors);
+ AliQADataMakerRec *qadm = GetQADataMaker(fgkNDetectors);
AliInfo(Form("Initializing the global QA data maker"));
TObjArray *arr=
qadm->Init(AliQA::kRECPOINTS, AliCDBManager::Instance()->GetRun());
TString detStr(fFillESD);
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
- AliQADataMaker *qadm = GetQADataMaker(iDet);
+ AliQADataMakerRec *qadm = GetQADataMaker(iDet);
if (!qadm) continue;
qadm->StartOfCycle(AliQA::kRECPOINTS);
qadm->StartOfCycle(AliQA::kESDS, "same") ;
}
if (fRunGlobalQA) {
- AliQADataMaker *qadm = GetQADataMaker(fgkNDetectors);
+ AliQADataMakerRec *qadm = GetQADataMaker(fgkNDetectors);
qadm->StartOfCycle(AliQA::kRECPOINTS);
}
}
TString detStr(fFillESD);
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
- AliQADataMaker * qadm = GetQADataMaker(iDet);
+ AliQADataMakerRec * qadm = GetQADataMaker(iDet);
if (!qadm) continue;
qadm->EndOfCycle(AliQA::kRECPOINTS);
qadm->EndOfCycle(AliQA::kESDS);
qadm->Finish();
}
if (fRunGlobalQA) {
- AliQADataMaker *qadm = GetQADataMaker(fgkNDetectors);
+ AliQADataMakerRec *qadm = GetQADataMaker(fgkNDetectors);
if (qadm) {
qadm->EndOfCycle(AliQA::kRECPOINTS);
qadm->Finish();
qas.Run(fRunTracking.Data(), AliQA::kESDS);
if (fRunGlobalQA) {
- AliQADataMaker *qadm = GetQADataMaker(fgkNDetectors);
+ AliQADataMakerRec *qadm = GetQADataMaker(fgkNDetectors);
if (qadm) {
qadm->EndOfCycle(AliQA::kRECPOINTS);
qadm->Finish();
// In-loop QA for local reconstrucion
if (fRunQA && fInLoopQA) {
- AliQADataMaker * qadm = GetQADataMaker(iDet);
+ AliQADataMakerRec * qadm = GetQADataMaker(iDet);
if (qadm) {
//AliCodeTimerStart
//(Form("Running QA data maker for %s", fgkDetectorName[iDet]));
}
//_____________________________________________________________________________
-AliQADataMaker * AliReconstruction::GetQADataMaker(Int_t iDet)
+AliQADataMakerRec * AliReconstruction::GetQADataMaker(Int_t iDet)
{
// get the quality assurance data maker object and the loader for a detector
if (fQADataMaker[iDet])
return fQADataMaker[iDet];
- AliQADataMaker * qadm = NULL;
- if (iDet==fgkNDetectors) { //Global QA
- qadm=new AliGlobalQADataMaker();
+ AliQADataMakerRec * qadm = NULL;
+ if (iDet == fgkNDetectors) { //Global QA
+ qadm = new AliGlobalQADataMaker();
fQADataMaker[iDet] = qadm;
return qadm;
}
// load the QA data maker object
TPluginManager* pluginManager = gROOT->GetPluginManager();
TString detName = fgkDetectorName[iDet];
- TString qadmName = "Ali" + detName + "QADataMaker";
+ TString qadmName = "Ali" + detName + "QADataMakerRec";
if (gAlice && !gAlice->GetDetector(detName) && (detName != "HLT"))
return NULL;
// first check if a plugin is defined for the quality assurance data maker
- TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName);
+ TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMakerRec", detName);
// if not, add a plugin for it
if (!pluginHandler) {
AliDebug(1, Form("defining plugin for %s", qadmName.Data()));
TString libs = gSystem->GetLibraries();
if (libs.Contains("lib" + detName + "base.so") ||
(gSystem->Load("lib" + detName + "base.so") >= 0)) {
- pluginManager->AddHandler("AliQADataMaker", detName,
+ pluginManager->AddHandler("AliQADataMakerRec", detName,
qadmName, detName + "qadm", qadmName + "()");
} else {
- pluginManager->AddHandler("AliQADataMaker", detName,
+ pluginManager->AddHandler("AliQADataMakerRec", detName,
qadmName, detName, qadmName + "()");
}
- pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName);
+ pluginHandler = pluginManager->FindHandler("AliQADataMakerRec", detName);
}
if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
- qadm = (AliQADataMaker *) pluginHandler->ExecPlugin(0);
+ qadm = (AliQADataMakerRec *) pluginHandler->ExecPlugin(0);
}
fQADataMaker[iDet] = qadm;
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr))
continue;
- AliQADataMaker * qadm = GetQADataMaker(iDet);
+ AliQADataMakerRec * qadm = GetQADataMaker(iDet);
if (!qadm)
continue;
AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
class TFile;
class TTree;
class TList;
-class AliQADataMaker;
+class AliQADataMakerRec;
class AliReconstruction: public TNamed {
public:
//Quality Assurance
Int_t GetDetIndex(const char * detector);
- AliQADataMaker* GetQADataMaker(Int_t iDet);
+ AliQADataMakerRec* GetQADataMaker(Int_t iDet);
const Int_t GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; }
void CheckQA() ;
Bool_t fSetRunNumberFromDataCalled; //! flag to check if run number is already loaded from run loader
//Quality Assurance
- AliQADataMaker *fQADataMaker[fgkNDetectors+1]; //! array of QA data makers
- Int_t fQACycles[fgkNDetectors];// # events over which QA data are accumulated
- Bool_t fRunQA ; // Run QA flag
- Bool_t fRunGlobalQA; // Run global QA flag
- Bool_t fInLoopQA; // In-loop QA flag
+ AliQADataMakerRec *fQADataMaker[fgkNDetectors+1]; //! array of QA data makers
+ Int_t fQACycles[ fgkNDetectors];// # events over which QA data are accumulated
+ Bool_t fRunQA ; // Run QA flag
+ Bool_t fRunGlobalQA; // Run global QA flag
+ Bool_t fInLoopQA; // In-loop QA flag
ClassDef(AliReconstruction, 19) // class for running the reconstruction
};
}
}
- // //QA
-// if (fRunQA) {
-// Bool_t rv = RunQA() ;
-// if (!rv)
-// if (fStopOnError)
-// return kFALSE ;
-// }
+ //QA
+ if (fRunQA) {
+ Bool_t rv = RunQA() ;
+ if (!rv)
+ if (fStopOnError)
+ return kFALSE ;
+ }
// Cleanup of CDB manager: cache and active storages!
AliCDBManager::Instance()->ClearCache();
static const Int_t fgkNDetectors = 15 ; // number of detectors
static const char * fgkDetectorName[fgkNDetectors] ; // names of detectors
Int_t fQACycles[fgkNDetectors] ; // cycle length (# events) over which QA data are accumulated
- Bool_t fRunQA ; // Runs the QA at the end of simulation
+ Bool_t fRunQA ; // Runs the QA at the end of simulation
//HLT
TString fRunHLT; // HLT options, HLT is disabled if empty, default='default'
#pragma link C++ class AliCTPRawData+;
#pragma link C++ class AliQADataMaker+;
+#pragma link C++ class AliQADataMakerSim+;
+#pragma link C++ class AliQADataMakerRec+;
#pragma link C++ class AliGlobalQADataMaker+;
#pragma link C++ class AliQADataMakerSteer+;
#pragma link C++ class AliQAChecker+;
AliCTPRawData.cxx \
AliQADataMaker.cxx \
AliGlobalQADataMaker.cxx \
+AliQADataMakerSim.cxx \
+AliQADataMakerRec.cxx \
AliQADataMakerSteer.cxx \
AliQAChecker.cxx \
AliQACheckerBase.cxx \
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+
+/* $Id$ */
+
+//---
+// Produces the data needed to calculate the quality assurance.
+// All data must be mergeable objects.
+// A. Mastroserio
+//---
+
+// --- 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 "AliT0digit.h"
+#include "AliT0hit.h"
+#include "AliT0RecPoint.h"
+#include "AliT0QADataMakerRec.h"
+#include "AliQAChecker.h"
+#include "AliT0RawReader.h"
+
+ClassImp(AliT0QADataMakerRec)
+
+//____________________________________________________________________________
+ AliT0QADataMakerRec::AliT0QADataMakerRec() :
+ AliQADataMakerRec(AliQA::GetDetName(AliQA::kT0), "T0 Quality Assurance Data Maker")
+
+{
+ // ctor
+ /*
+ for(Int_t i=0; i<24; i++) {
+ fhHitsTime[i]=0x0;
+ fhDigCFD[i]=0x0;
+ fhDigLEDamp[i]=0x0;
+ fhRecCFD[i]=0x0;
+ fhRecLEDamp[i]=0x0;
+ fhRecQTC[i]=0x0;
+ }
+ */
+ // fDetectorDir = fOutput->GetDirectory(GetName()) ;
+// if (!fDetectorDir)
+// fDetectorDir = fOutput->mkdir(GetName()) ;
+}
+
+//____________________________________________________________________________
+AliT0QADataMakerRec::AliT0QADataMakerRec(const AliT0QADataMakerRec& qadm) :
+ AliQADataMakerRec()
+{
+ //copy ctor
+ /*
+ for(Int_t i=0; i<24; i++) {
+ fhHitsTime[i]=0x0;
+ fhDigCFD[i]=0x0;
+ fhDigLEDamp[i]=0x0;
+ fhRecCFD[i]=0x0;
+ fhRecLEDamp[i]=0x0;
+ fhRecQTC[i]=0x0;
+ }
+ */
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliT0QADataMakerRec& AliT0QADataMakerRec::operator = (const AliT0QADataMakerRec& qadm )
+{
+ // Equal operator.
+ this->~AliT0QADataMakerRec();
+ new(this) AliT0QADataMakerRec(qadm);
+ return *this;
+}
+//____________________________________________________________________________
+void AliT0QADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+{
+ //Detector specific actions at end of cycle
+ // do the QA checking
+ AliQAChecker::Instance()->Run(AliQA::kT0, task, list) ;
+}
+
+//____________________________________________________________________________
+void AliT0QADataMakerRec::StartOfDetectorCycle()
+{
+ //Detector specific actions at start of cycle
+
+}
+
+//____________________________________________________________________________
+void AliT0QADataMakerRec::InitRaws()
+{
+ // create Raw histograms in Raw subdir
+ printf(" AliT0QADataMakerRec::InitRaws() started\n");
+ TString timename, ampname, qtcname;
+
+ TH1F *fhRawCFD[24]; TH1F * fhRawLEDamp[24]; TH1F *fhRawQTC[24];
+
+ for (Int_t i=0; i<24; i++)
+ {
+ timename ="hRawCFD";
+ ampname = "hRawLED";
+ qtcname = "hRawQTC";
+ timename += i;
+ ampname += i;
+ qtcname += i;
+ fhRawCFD[i] = new TH1F(timename.Data(), timename.Data(),100,100,5000);
+ Add2RawsList( fhRawCFD[i],i);
+ fhRawLEDamp[i] = new TH1F(ampname.Data(), ampname.Data(),100,120000,150000);
+ Add2RawsList( fhRawLEDamp[i],i+24);
+ fhRawQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,100,500);
+ Add2RawsList( fhRawQTC[i],i+48);
+ }
+
+ TH1F* fhRawMean = new TH1F("hRawMean","online mean signal", 100,500,600);
+ Add2RawsList( fhRawMean,72);
+
+}
+
+//____________________________________________________________________________
+
+void AliT0QADataMakerRec::InitRecPoints()
+{
+ // create cluster histograms in RecPoint subdir
+ /*
+ TH2F * fhRecCFD = new TH2F("fhRecCFD", " CFD reconstructed",25,-0.5,24.5,100,12,13);
+ Add2DigitsList( fhRecCFD,0);
+ TH2F *fhRecLEDamp = new TH2F("fhRecLEDamp", " amplitude LED reconstructed",25,-0.5,24.5,100,1000,1000);
+ Add2DigitsList( fhRecLEDamp,1);
+ TH2F * fhRecQTC = new TH2F("fhRecQTC", " amplitude QTC reconstructed",25,-0.5,24.5,100,1000,1000);
+ Add2DigitsList( fhRecQTC,2);
+ TH1F * fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,500,600);
+ Add2DigitsList( fhRecMean,3);
+ */
+
+ TString timename,ampname, qtcname;
+ TH1F *fhRecCFD[24]; TH1F *fhRecLEDAmp[24]; TH1F * fhRecQTC[24];
+ for (Int_t i=0; i<24; i++)
+ {
+ timename ="hRecCFD";
+ ampname = "hRecLED";
+ qtcname = "hRecQTC";
+ timename += i;
+ ampname += i;
+ qtcname += i;
+ fhRecCFD[i] = new TH1F(timename.Data(), timename.Data(),100,0,1000);
+ Add2RecPointsList ( fhRecCFD[i],i);
+ fhRecLEDAmp[i] = new TH1F(ampname.Data(), ampname.Data(),100,0,200);
+ Add2RecPointsList ( fhRecLEDAmp[i],i+24);
+ fhRecQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,0,200);
+ Add2RecPointsList ( fhRecQTC[i],i+48);
+ }
+
+ TH1F *fhRecEff = new TH1F("hRecEff","Efficiency rec.points",25,-0.5,24.5);
+ Add2RecPointsList ( fhRecEff,72);
+ TH1F * fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,500,600);
+ Add2RecPointsList( fhRecMean,73);
+
+}
+
+//____________________________________________________________________________
+void AliT0QADataMakerRec::InitESDs()
+{
+ //create ESDs histograms in ESDs subdir
+ TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean",100,0,100);
+ Add2ESDsList(fhESDMean, 0) ;
+ TH1F * fhESDVertex = new TH1F("hESDvertex","EAD vertex",100,-50,50);
+ Add2ESDsList(fhESDVertex, 1) ;
+
+
+}
+
+//____________________________________________________________________________
+void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
+{
+ Int_t allData[110][5];
+ for (Int_t i0=0; i0<105; i0++)
+ {
+ for (Int_t j0=0; j0<5; j0++) allData[i0][j0]=0;
+ }
+ //fills QA histos for RAW
+AliT0RawReader *start = new AliT0RawReader(rawReader);
+
+ while (rawReader->NextEvent()) {
+ start->Next();
+ for (Int_t i=0; i<105; i++)
+ for (Int_t iHit=0; iHit<5; iHit++)
+ allData[i][iHit]= start->GetData(i,iHit);
+
+
+ for (Int_t ik = 0; ik<24; ik+=2){
+ for (Int_t iHt=0; iHt<5; iHt++){
+ Int_t cc = ik/2;
+ if(allData[cc+1][iHt]!=0){
+ GetRawsData(cc) -> Fill(allData[cc+1][iHt]-allData[0][0]);
+ if(allData[ik+25][iHt]!=0 && allData[ik+26][iHt]!=0)
+ GetRawsData(cc+48)->Fill(allData[ik+26][iHt]-allData[ik+25][iHt]);
+ if(allData[cc+13][iHt]!=0 )
+ GetRawsData(cc+24)->Fill(allData[cc+13][iHt]-allData[cc+1][iHt]);
+ }
+ }
+ }
+
+ for (Int_t ik = 24; ik<48; ik+=2) {
+ for (Int_t iHt=0; iHt<5; iHt++) {
+ Int_t cc = ik/2;
+ if(allData[cc+45][iHt]!=0) {
+ GetRawsData(cc)->Fill(allData[cc+1][iHt]-allData[0][0]);
+ if(allData[ik+57][iHt]!=0 && allData[ik+58][iHt]!=0)
+ GetRawsData(cc+48)->Fill(allData[ik+57][iHt]-allData[ik+58][iHt]);
+ if(allData[cc+57][iHt]!=0 )
+ GetRawsData(cc+48)->Fill(allData[cc+57][iHt]-allData[cc+45][iHt]);
+ }
+ }
+ }
+
+ }
+
+}
+
+//____________________________________________________________________________
+void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree)
+{
+ //fills QA histos for clusters
+
+ AliT0RecPoint* frecpoints= new AliT0RecPoint ();
+ if (!frecpoints) {
+ AliError("Reconstruct Fill ESD >> no recpoints found");
+ return;
+ }
+ TBranch *brRec =clustersTree ->GetBranch("T0");
+ if (brRec) {
+ brRec->SetAddress(&frecpoints);
+ }else{
+ AliError(Form("EXEC Branch T0 rec not found "));
+ return;
+ }
+
+ brRec->GetEntry(0);
+
+ for ( Int_t i=0; i<24; i++) {
+ GetRecPointsData(i) -> Fill(frecpoints -> GetTime(i));
+ GetRecPointsData(i+24) -> Fill(frecpoints -> GetAmp(i));
+ GetRecPointsData(i+48) -> Fill(frecpoints->AmpLED(i));
+ // if(frecpoints -> GetTime(i) > 0) fhRecEff->Fill(i);
+ }
+ GetRecPointsData(72) ->Fill(frecpoints->GetMeanTime());
+
+}
+
+//____________________________________________________________________________
+void AliT0QADataMakerRec::MakeESDs(AliESDEvent * esd)
+{
+ //fills QA histos for ESD
+
+ GetESDsData(0) -> Fill(esd->GetT0());
+ GetESDsData(1)-> Fill(esd->GetT0zVertex());
+
+}
+
--- /dev/null
+#ifndef AliT0QADataMakerRec_H
+#define AliT0QADataMakerRec_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+//
+// Produces the data needed to calculate the quality assurance.
+// All data must be mergeable objects.
+// A. Mastroserio
+
+
+
+// --- ROOT system ---
+
+
+
+// --- Standard library ---
+// --- AliRoot header files ---
+
+#include "AliQADataMakerRec.h"
+
+class AliT0QADataMakerRec: public AliQADataMakerRec {
+
+public:
+ AliT0QADataMakerRec() ; // ctor
+ AliT0QADataMakerRec(const AliT0QADataMakerRec& qadm) ;
+ AliT0QADataMakerRec& operator = (const AliT0QADataMakerRec& qadm) ;
+ virtual ~AliT0QADataMakerRec() {;} // dtor
+
+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, TObjArray * list) ;
+ virtual void StartOfDetectorCycle() ;
+ ClassDef(AliT0QADataMakerRec,1) // description
+
+};
+
+#endif // AliT0QADataMakerRec_H
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+
+/* $Id$ */
+
+//---
+// Produces the data needed to calculate the quality assurance.
+// All data must be mergeable objects.
+// A. Mastroserio
+//---
+
+// --- 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 "AliT0digit.h"
+#include "AliT0hit.h"
+#include "AliT0RecPoint.h"
+#include "AliT0QADataMakerSim.h"
+#include "AliQAChecker.h"
+#include "AliT0RawReader.h"
+
+ClassImp(AliT0QADataMakerSim)
+
+//____________________________________________________________________________
+ AliT0QADataMakerSim::AliT0QADataMakerSim() :
+ AliQADataMakerSim(AliQA::GetDetName(AliQA::kT0), "T0 Quality Assurance Data Maker")
+
+{
+ // ctor
+ /*
+ for(Int_t i=0; i<24; i++) {
+ fhHitsTime[i]=0x0;
+ fhDigCFD[i]=0x0;
+ fhDigLEDamp[i]=0x0;
+ fhRecCFD[i]=0x0;
+ fhRecLEDamp[i]=0x0;
+ fhRecQTC[i]=0x0;
+ }
+ */
+ // fDetectorDir = fOutput->GetDirectory(GetName()) ;
+// if (!fDetectorDir)
+// fDetectorDir = fOutput->mkdir(GetName()) ;
+}
+
+//____________________________________________________________________________
+AliT0QADataMakerSim::AliT0QADataMakerSim(const AliT0QADataMakerSim& qadm) :
+ AliQADataMakerSim()
+{
+ //copy ctor
+ /*
+ for(Int_t i=0; i<24; i++) {
+ fhHitsTime[i]=0x0;
+ fhDigCFD[i]=0x0;
+ fhDigLEDamp[i]=0x0;
+ fhRecCFD[i]=0x0;
+ fhRecLEDamp[i]=0x0;
+ fhRecQTC[i]=0x0;
+ }
+ */
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliT0QADataMakerSim& AliT0QADataMakerSim::operator = (const AliT0QADataMakerSim& qadm )
+{
+ // Equal operator.
+ this->~AliT0QADataMakerSim();
+ new(this) AliT0QADataMakerSim(qadm);
+ return *this;
+}
+//____________________________________________________________________________
+void AliT0QADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+{
+ //Detector specific actions at end of cycle
+ // do the QA checking
+ AliQAChecker::Instance()->Run(AliQA::kT0, task, list) ;
+}
+
+//____________________________________________________________________________
+void AliT0QADataMakerSim::StartOfDetectorCycle()
+{
+ //Detector specific actions at start of cycle
+
+}
+
+//____________________________________________________________________________
+void AliT0QADataMakerSim::InitHits()
+{
+ // create Hits histograms in Hits subdir
+ TString timename;
+ TH1F * fhHitsTime[24];
+ for (Int_t i=0; i<24; i++)
+ {
+ timename ="hHitTime";
+ timename += i;
+ if(i<12) fhHitsTime[i] = new TH1F(timename.Data(),timename.Data(),100,2000,3000);
+ else
+ fhHitsTime[i] = new TH1F(timename.Data(),timename.Data(),100,12000,13000);
+ Add2HitsList( fhHitsTime[i],i);
+ }
+ /*
+ TH2F *fhHitsEffA = new TH2F("hHitsEffA", "Hits Efficiency A side", 25,-0.5,24.5, 100,12,13 );
+ Add2HitsList(fhHitsEffA,0);
+ TH2F *fhHitsEffC = new TH2F("hHitsEffC", "Hits Efficiency C side", 25,-0.5,24.5, 100,2,3 );
+ Add2HitsList(fhHitsEffC,1);
+ */
+}
+
+//____________________________________________________________________________
+void AliT0QADataMakerSim::InitDigits()
+{
+ // create Digits histograms in Digits subdir
+
+ /*
+ TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits",25,-0.5,24.5,100,100,1000);
+ Add2DigitsList( fhDigCFD,0);
+ TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits",25,-0.5,24.5,100,100,1000);
+ Add2DigitsList( fhDigLEDamp,1);
+ TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits",25,-0.5,24.5,100,100,1000);
+ Add2DigitsList( fhDigQTC,2);
+ TH1F * fhDigMean = new TH1F("hDigMean","online mean signal", 100,500,600);
+ Add2DigitsList( fhDigMean,23);
+ */
+
+ TString timename, ampname, qtcname;
+
+ TH1F *fhDigCFD[24]; TH1F * fhDigLEDamp[24]; TH1F *fhDigQTC[24];
+
+ for (Int_t i=0; i<24; i++)
+ {
+ timename ="hDigCFD";
+ ampname = "hDigLED";
+ qtcname = "hDigQTC";
+ timename += i;
+ ampname += i;
+ qtcname += i;
+ fhDigCFD[i] = new TH1F(timename.Data(), timename.Data(),100,100,5000);
+ Add2DigitsList( fhDigCFD[i],i);
+ fhDigLEDamp[i] = new TH1F(ampname.Data(), ampname.Data(),100,120000,150000);
+ Add2DigitsList( fhDigLEDamp[i],i+24);
+ fhDigQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,100,500);
+ Add2DigitsList( fhDigQTC[i],i+48);
+ }
+
+ TH1F* fhDigEff = new TH1F("hDigEff","digits efficiency", 25,-0.5,24.5);
+ Add2DigitsList( fhDigEff,72);
+ TH1F* fhDigMean = new TH1F("hDigMean","online mean signal", 100,500,600);
+ Add2DigitsList( fhDigMean,73);
+
+}
+
+//____________________________________________________________________________
+
+void AliT0QADataMakerSim::MakeHits(TTree *hitTree)
+{
+ //fills QA histos for Hits
+ TClonesArray * hits = new TClonesArray("AliT0hit", 1000);
+
+ TBranch * branch = hitTree->GetBranch("T0") ;
+ if ( ! branch ) {
+ AliWarning("T0 branch in Hit Tree not found") ;
+ } else {
+
+ if (branch) {
+ branch->SetAddress(&hits);
+ }else{
+ AliError("Branch T0 hit not found");
+ exit(111);
+ }
+ Int_t ntracks = (Int_t) hitTree->GetEntries();
+
+ if (ntracks<=0) return;
+ // Start loop on tracks in the hits containers
+ for (Int_t track=0; track<ntracks;track++) {
+ branch->GetEntry(track);
+ Int_t nhits = hits->GetEntriesFast();
+ for (Int_t ihit=0;ihit<nhits;ihit++)
+ {
+ AliT0hit * startHit = (AliT0hit*) hits->UncheckedAt(ihit);
+ if (!startHit) {
+ AliError("The unchecked hit doesn't exist");
+ break;
+ }
+ Int_t pmt=startHit->Pmt();
+ GetHitsData(pmt-1)->Fill(startHit->Time()) ;
+ }
+ }
+ }
+}
+
+//____________________________________________________________________________
+void AliT0QADataMakerSim::MakeDigits( TTree *digitsTree)
+{
+ //fills QA histos for Digits
+
+ TArrayI *digCFD = new TArrayI(24);
+ TArrayI *digLED = new TArrayI(24);
+ TArrayI *digQT0 = new TArrayI(24);
+ TArrayI *digQT1 = new TArrayI(24);
+ Int_t refpoint=0;
+
+ TBranch *brDigits=digitsTree->GetBranch("T0");
+ AliT0digit *fDigits = new AliT0digit() ;
+ if (brDigits) {
+ brDigits->SetAddress(&fDigits);
+ }else{
+ AliError(Form("EXEC Branch T0 digits not found"));
+ return;
+ }
+
+ digitsTree->GetEvent(0);
+ digitsTree->GetEntry(0);
+ brDigits->GetEntry(0);
+ fDigits->GetTimeCFD(*digCFD);
+ fDigits->GetTimeLED(*digLED);
+ fDigits->GetQT0(*digQT0);
+ fDigits->GetQT1(*digQT1);
+ refpoint = fDigits->RefPoint();
+ for (Int_t i=0; i<24; i++)
+ {
+ if (digCFD->At(i)>0) {
+ Int_t cfd=digCFD->At(i)- refpoint;
+ GetDigitsData(i) ->Fill(cfd);
+ GetDigitsData(i+24) -> Fill(digLED->At(i) - digCFD->At(i));
+ GetDigitsData(i+48) -> Fill(digQT1->At(i) - digQT0->At(i));
+ }
+ }
+
+ delete digCFD;
+ delete digLED;
+ delete digQT0;
+ delete digQT1;
+
+}
--- /dev/null
+#ifndef AliT0QADataMakerSim_H
+#define AliT0QADataMakerSim_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+//
+// Produces the data needed to calculate the quality assurance.
+// All data must be mergeable objects.
+// A. Mastroserio
+
+
+
+// --- ROOT system ---
+
+
+
+// --- Standard library ---
+// --- AliRoot header files ---
+
+#include "AliQADataMakerSim.h"
+
+class AliT0QADataMakerSim: public AliQADataMakerSim {
+
+public:
+ AliT0QADataMakerSim() ; // ctor
+ AliT0QADataMakerSim(const AliT0QADataMakerSim& qadm) ;
+ AliT0QADataMakerSim& operator = (const AliT0QADataMakerSim& qadm) ;
+ virtual ~AliT0QADataMakerSim() {;} // dtor
+
+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 MakeDigits(TTree* digitsTree) ; //Fill Digit QA histo
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * list) ;
+ virtual void StartOfDetectorCycle() ;
+ ClassDef(AliT0QADataMakerSim,1) // description
+
+};
+
+#endif // AliT0QADataMakerSim_H
#pragma link C++ class AliT0LookUpValue+;
#pragma link C++ class AliT0LookUpKey+;
#pragma link C++ class AliT0Align+;
-#pragma link C++ class AliT0QADataMaker+;
#pragma link C++ class AliT0QAChecker+;
#endif
#pragma link C++ class AliT0RawReader+;
#pragma link C++ class AliT0Calibrator+;
#pragma link C++ class AliT0CalibLaserData+;
+#pragma link C++ class AliT0QADataMakerRec+;
#endif
#pragma link C++ class AliT0hit+;
#pragma link C++ class AliT0Digitizer+;
#pragma link C++ class AliT0RawData+;
+#pragma link C++ class AliT0QADataMakerSim+;
#endif
SRCS= AliT0.cxx AliT0digit.cxx AliT0Trigger.cxx \
AliT0CalibData.cxx AliT0CalibTimeEq.cxx AliT0CalibWalk.cxx \
AliT0Parameters.cxx AliT0LookUpValue.cxx \
- AliT0Align.cxx AliT0QADataMaker.cxx AliT0QAChecker.cxx
+ AliT0Align.cxx AliT0QAChecker.cxx
HDRS= $(SRCS:.cxx=.h)
#-*- Mode: Makefile -*-
# $Id$
-SRCS= AliT0RecPoint.cxx AliT0Reconstructor.cxx AliT0RawReader.cxx AliT0Calibrator.cxx AliT0CalibLaserData.cxx
+SRCS= AliT0RecPoint.cxx AliT0Reconstructor.cxx AliT0RawReader.cxx AliT0Calibrator.cxx AliT0CalibLaserData.cxx AliT0QADataMakerRec.cxx
HDRS= $(SRCS:.cxx=.h)
#-*- Mode: Makefile -*-
# $Id$
-SRCS= AliT0v0.cxx AliT0v1.cxx AliT0hit.cxx AliT0Digitizer.cxx AliT0RawData.cxx
+SRCS= AliT0v0.cxx AliT0v1.cxx AliT0hit.cxx AliT0Digitizer.cxx AliT0RawData.cxx AliT0QADataMakerSim.cxx
HDRS= $(SRCS:.cxx=.h)
--- /dev/null
+/**************************************************************************
+ * 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 TOF quality assurance. //
+// QA objects are 1 & 2 Dimensional histograms. //
+// author: S.Arcelli //
+// //
+///////////////////////////////////////////////////////////////////////
+
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TH1I.h>
+#include <TH1F.h>
+#include <TH2F.h>
+#include "AliESDEvent.h"
+#include "AliESDtrack.h"
+#include "AliTOFcluster.h"
+#include "AliTOFQADataMakerRec.h"
+#include "AliQAChecker.h"
+#include "AliRawReader.h"
+#include "AliTOFRawStream.h"
+#include "AliTOFrawData.h"
+#include "AliLog.h"
+
+ClassImp(AliTOFQADataMakerRec)
+
+//____________________________________________________________________________
+ AliTOFQADataMakerRec::AliTOFQADataMakerRec() :
+ AliQADataMakerRec(AliQA::GetDetName(AliQA::kTOF), "TOF Quality Assurance Data Maker")
+{
+ //
+ // ctor
+ //
+}
+
+//____________________________________________________________________________
+AliTOFQADataMakerRec::AliTOFQADataMakerRec(const AliTOFQADataMakerRec& qadm) :
+ AliQADataMakerRec()
+{
+ //
+ //copy ctor
+ //
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliTOFQADataMakerRec& AliTOFQADataMakerRec::operator = (const AliTOFQADataMakerRec& qadm )
+{
+ //
+ // assignment operator.
+ //
+ this->~AliTOFQADataMakerRec();
+ new(this) AliTOFQADataMakerRec(qadm);
+ return *this;
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::InitRaws()
+{
+ //
+ // create Raws histograms in Raws subdir
+ //
+ TH1F * h0 = new TH1F("hTOFRaws", "Number of TOF Raws ",301, -1.02, 5.) ; h0->Sumw2() ;
+ Add2RawsList(h0, 0) ;
+
+ TH1F * h1 = new TH1F("hTOFRawsTime", "Raws Time Spectrum in TOF (ns)", 2000, 0., 200) ;
+ h1->Sumw2() ;
+ Add2RawsList(h1, 1) ;
+
+ TH1F * h2 = new TH1F("hTOFRawsToT", "Raws ToT Spectrum in TOF (ns)", 500, 0., 50) ;
+ h2->Sumw2() ;
+ Add2RawsList(h2, 2) ;
+
+ TH2F * h3 = new TH2F("hTOFRawsClusMap","Raws vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ;
+ h3->Sumw2() ;
+ Add2RawsList(h3, 3) ;
+
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::InitRecPoints()
+{
+ //
+ // create RecPoints histograms in RecPoints subdir
+ //
+ TH1F * h0 = new TH1F("hTOFRecPoints", "Number of TOF RecPoints ",301, -1.02, 5.) ; h0->Sumw2() ;
+ Add2RecPointsList(h0, 0) ;
+
+ TH1F * h1 = new TH1F("hTOFRecPointsTime", "RecPoints Time Spectrum in TOF (ns)", 2000, 0., 200) ;
+ h1->Sumw2() ;
+ Add2RecPointsList(h1, 1) ;
+
+ TH1F * h2 = new TH1F("hTOFRecPointsRawTime", "RecPoints raw Time Spectrum in TOF (ns)", 2000, 0., 200) ;
+ h2->Sumw2() ;
+ Add2RecPointsList(h2, 2) ;
+
+ TH1F * h3 = new TH1F("hTOFRecPointsToT", "RecPoints ToT Spectrum in TOF (ns)", 500, 0., 50) ;
+ h3->Sumw2() ;
+ Add2RecPointsList(h3, 3) ;
+
+ TH2F * h4 = new TH2F("hTOFRecPointsClusMap","RecPoints vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ;
+ h4->Sumw2() ;
+ Add2RecPointsList(h4, 4) ;
+
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::InitESDs()
+{
+ //
+ //create ESDs histograms in ESDs subdir
+ //
+ TH1F * h0 = new TH1F("hTOFESDs", "Number of matched TOF tracks over ESDs", 250, -1., 4.) ;
+ h0->Sumw2() ;
+ Add2ESDsList(h0, 0) ;
+
+ TH1F * h1 = new TH1F("hTOFESDsTime", "Time Spectrum in TOF (ns)", 2000, 0., 200) ;
+ h1->Sumw2() ;
+ Add2ESDsList(h1, 1) ;
+
+ TH1F * h2 = new TH1F("hTOFESDsRawTime", "raw Time Spectrum in TOF (ns)", 2000, 0., 200) ;
+ h2->Sumw2() ;
+ Add2ESDsList(h2, 2) ;
+
+ TH1F * h3 = new TH1F("hTOFESDsToT", "ToT Spectrum in TOF (ns)", 500, 0., 50) ;
+ h3->Sumw2() ;
+ Add2ESDsList(h3, 3) ;
+
+ TH1F * h4 = new TH1F("hTOFESDsPID", "Fraction of matched TOF tracks with good PID glag", 100, 0., 1.) ;
+ h4->Sumw2() ;
+ Add2ESDsList(h4, 4) ;
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
+{
+ //
+ // makes data from Raws
+ //
+
+ Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
+ Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
+
+
+ Int_t ntof = 0 ;
+ Int_t in[5];
+ Int_t out[5];
+
+ TClonesArray * clonesRawData;
+ AliTOFRawStream tofInput(rawReader);
+ for (Int_t iDDL = 0; iDDL < AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); iDDL++){
+ rawReader->Reset();
+ tofInput.LoadRawData(iDDL);
+ clonesRawData = (TClonesArray*)tofInput.GetRawData();
+ for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) {
+ AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
+ if (!tofRawDatum->GetTOT() || !tofRawDatum->GetTOF()) continue;
+ ntof++;
+ GetRawsData(1)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
+ GetRawsData(2)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns
+
+ tofInput.EquipmentId2VolumeId(iDDL,
+ tofRawDatum->GetTRM(),
+ tofRawDatum->GetTRMchain(),
+ tofRawDatum->GetTDC(),
+ tofRawDatum->GetTDCchannel(),
+ in);
+
+ GetMapIndeces(in,out);
+ GetRawsData(3)->Fill( out[0],out[1]) ;//raw map
+
+ } // while loop
+
+ clonesRawData->Clear();
+
+ } // DDL Loop
+
+ Int_t nentries=ntof;
+ if(nentries<=0){
+ GetRawsData(0)->Fill(-1.) ;
+ }else{
+ GetRawsData(0)->Fill(TMath::Log10(nentries)) ;
+ }
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::MakeRecPoints(TTree * clustersTree)
+{
+ //
+ // Make data from Clusters
+ //
+
+ Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
+ Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
+
+ Int_t in[5];
+ Int_t out[5];
+
+ TBranch *branch=clustersTree->GetBranch("TOF");
+ if (!branch) {
+ AliError("can't get the branch with the TOF clusters !");
+ return;
+ }
+
+ TClonesArray dummy("AliTOFcluster",10000), *clusters=&dummy;
+ branch->SetAddress(&clusters);
+
+ // Import the tree
+ clustersTree->GetEvent(0);
+
+ Int_t nentries=clusters->GetEntriesFast();
+ if(nentries<=0){
+ GetRecPointsData(0)->Fill(-1.) ;
+ }else{
+ GetRecPointsData(0)->Fill(TMath::Log10(nentries)) ;
+ }
+
+ TIter next(clusters) ;
+ AliTOFcluster * c ;
+ while ( (c = dynamic_cast<AliTOFcluster *>(next())) ) {
+ GetRecPointsData(1)->Fill(c->GetTDC()*tdc2ns);
+ GetRecPointsData(2)->Fill(c->GetTDCRAW()*tdc2ns);
+ GetRecPointsData(3)->Fill(c->GetToT()*tot2ns);
+
+ in[0] = c->GetDetInd(0);
+ in[1] = c->GetDetInd(1);
+ in[2] = c->GetDetInd(2);
+ in[3] = c->GetDetInd(4); //X and Z indeces inverted in RecPoints
+ in[4] = c->GetDetInd(3); //X and Z indeces inverted in RecPoints
+
+ GetMapIndeces(in,out);
+ GetRecPointsData(4)->Fill(out[0],out[1]);
+
+ }
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::MakeESDs(AliESDEvent * esd)
+{
+ //
+ // make QA data from ESDs
+ //
+ Int_t ntrk = esd->GetNumberOfTracks() ;
+ Int_t ntof=0;
+ Int_t ntofpid=0;
+ while (ntrk--) {
+ AliESDtrack *track=esd->GetTrack(ntrk);
+ Double_t tofTime=track->GetTOFsignal()*1E-3;//in ns
+ Double_t tofTimeRaw=track->GetTOFsignalRaw()*1E-3;//in ns
+ Double_t tofToT=track->GetTOFsignalToT(); //in ns
+ if(!(tofTime>0))continue;
+ ntof++;
+ GetESDsData(1)->Fill(tofTime);
+ GetESDsData(2)->Fill(tofTimeRaw);
+ GetESDsData(3)->Fill(tofToT);
+ //check how many tracks where ESD PID is ok
+ UInt_t status=track->GetStatus();
+ if (((status&AliESDtrack::kESDpid)==0) ||
+ ((status&AliESDtrack::kTOFpid)==0)) continue;
+ ntofpid++;
+ }
+
+ Int_t nentries=ntof;
+ if(nentries<=0){
+ GetESDsData(0)->Fill(-1.) ;
+ }else{
+ GetESDsData(0)->Fill(TMath::Log10(nentries)) ;
+ }
+
+ if(ntof>0)GetESDsData(4)->Fill(ntofpid/ntof) ;
+
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::StartOfDetectorCycle()
+{
+ //
+ //Detector specific actions at start of cycle
+ //to be implemented
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+{
+ //Detector specific actions at end of cycle
+ // do the QA checking
+
+ AliQAChecker::Instance()->Run(AliQA::kTOF, task, list) ;
+}
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::GetMapIndeces(Int_t* in , Int_t* out)
+{
+ //
+ //return appropriate indeces for the theta-phi map
+ //
+
+ Int_t npadX = AliTOFGeometry::NpadX();
+ Int_t npadZ = AliTOFGeometry::NpadZ();
+ Int_t nStripA = AliTOFGeometry::NStripA();
+ Int_t nStripB = AliTOFGeometry::NStripB();
+ Int_t nStripC = AliTOFGeometry::NStripC();
+
+ Int_t isector = in[0];
+ Int_t iplate = in[1];
+ Int_t istrip = in[2];
+ Int_t ipadX = in[3];
+ Int_t ipadZ = in[4];
+
+ Int_t stripOffset = 0;
+ switch (iplate) {
+ case 0:
+ stripOffset = 0;
+ break;
+ case 1:
+ stripOffset = nStripC;
+ break;
+ case 2:
+ stripOffset = nStripC+nStripB;
+ break;
+ case 3:
+ stripOffset = nStripC+nStripB+nStripA;
+ break;
+ case 4:
+ stripOffset = nStripC+nStripB+nStripA+nStripB;
+ break;
+ default:
+ AliError(Form("Wrong plate number in TOF (%d) !",iplate));
+ break;
+ };
+ Int_t zindex=npadZ*(istrip+stripOffset)+(ipadZ+1);
+ Int_t phiindex=npadX*isector+ipadX+1;
+ out[0]=zindex;
+ out[1]=phiindex;
+
+}
--- /dev/null
+#ifndef AliTOFQADataMakerRec_H
+#define AliTOFQADataMakerRec_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. //
+// S. Arcelli //
+// //
+////////////////////////////////////////////////////////////////////
+
+
+#include "AliQADataMakerRec.h"
+class AliTOFQADataMakerRec: public AliQADataMakerRec {
+
+public:
+ AliTOFQADataMakerRec() ; // ctor
+ AliTOFQADataMakerRec(const AliTOFQADataMakerRec& qadm) ;
+ AliTOFQADataMakerRec& operator = (const AliTOFQADataMakerRec& qadm) ;
+ virtual ~AliTOFQADataMakerRec() {;} // dtor
+
+private:
+ virtual void InitESDs() ;
+ virtual void InitRecPoints() ;
+ virtual void InitRaws() ;
+ virtual void MakeESDs(AliESDEvent * esd) ;
+ virtual void MakeRecPoints(TTree * recTree) ;
+ virtual void MakeRaws(AliRawReader* rawReader) ;
+ virtual void StartOfDetectorCycle() ;
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * list) ;
+ virtual void GetMapIndeces(Int_t *in, Int_t *out) ;
+
+ ClassDef(AliTOFQADataMakerRec,1) // description
+
+};
+
+#endif // AliTOFQADataMakerRec_H
--- /dev/null
+/**************************************************************************
+ * 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 TOF quality assurance. //
+// QA objects are 1 & 2 Dimensional histograms. //
+// author: S.Arcelli //
+// //
+///////////////////////////////////////////////////////////////////////
+
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TH1I.h>
+#include <TH1F.h>
+#include <TH2F.h>
+#include <TTree.h>
+#include <TMath.h>
+
+#include "AliTOFdigit.h"
+#include "AliTOFSDigit.h"
+#include "AliTOFhitT0.h"
+#include "AliTOFQADataMakerSim.h"
+#include "AliQAChecker.h"
+#include "AliLog.h"
+#include "AliTOFGeometry.h"
+
+
+ClassImp(AliTOFQADataMakerSim)
+
+//____________________________________________________________________________
+ AliTOFQADataMakerSim::AliTOFQADataMakerSim() :
+ AliQADataMakerSim(AliQA::GetDetName(AliQA::kTOF), "TOF Quality Assurance Data Maker")
+{
+ //
+ // ctor
+ //
+}
+
+//____________________________________________________________________________
+AliTOFQADataMakerSim::AliTOFQADataMakerSim(const AliTOFQADataMakerSim& qadm) :
+ AliQADataMakerSim()
+{
+ //
+ //copy ctor
+ //
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliTOFQADataMakerSim& AliTOFQADataMakerSim::operator = (const AliTOFQADataMakerSim& qadm )
+{
+ //
+ // assignment operator.
+ //
+ this->~AliTOFQADataMakerSim();
+ new(this) AliTOFQADataMakerSim(qadm);
+ return *this;
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::InitHits()
+{
+ //
+ // create Hits histograms in Hits subdir
+ //
+ TH1F * h0 = new TH1F("hTOFHits", "Number of TOF Hits ",301, -1.02, 5.) ;
+ h0->Sumw2() ;
+ Add2HitsList(h0, 0) ;
+
+ TH1F * h1 = new TH1F("hTOFHitsTime", "Hits Time Spectrum in TOF (ns)", 2000, 0., 200) ;
+ h1->Sumw2() ;
+ Add2HitsList(h1, 1) ;
+
+ TH1F * h2 = new TH1F("hTOFHitsLength", "Length Spectrum in TOF (cm)", 500, 0., 500) ;
+ h2->Sumw2() ;
+ Add2HitsList(h2, 2) ;
+
+ TH2F * h3 = new TH2F("hTOFHitsClusMap","Hits vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ;
+ h3->Sumw2() ;
+ Add2HitsList(h3, 3) ;
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::InitDigits()
+{
+ //
+ // create Digits histograms in Digits subdir
+ //
+ TH1F * h0 = new TH1F("hTOFDigits", "Number of TOF Digits ",301, -1.02, 5.) ; h0->Sumw2() ;
+ Add2DigitsList(h0, 0) ;
+
+ TH1F * h1 = new TH1F("hTOFDigitsTime", "Digits Time Spectrum in TOF (ns)", 2000, 0., 200) ;
+ h1->Sumw2() ;
+ Add2DigitsList(h1, 1) ;
+
+ TH1F * h2 = new TH1F("hTOFDigitsToT", "Digits ToT Spectrum in TOF (ns)", 500, 0., 50) ;
+ h2->Sumw2() ;
+ Add2DigitsList(h2, 2) ;
+
+ TH2F * h3 = new TH2F("hTOFDigitsClusMap","Digits vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ;
+ h3->Sumw2() ;
+ Add2DigitsList(h3, 3) ;
+
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::InitSDigits()
+{
+ //
+ // create SDigits histograms in SDigits subdir
+ //
+ TH1F * h0 = new TH1F("hTOFSDigits", "Number of TOF SDigits ",301, -1.02, 5.) ; h0->Sumw2() ;
+ Add2SDigitsList(h0, 0) ;
+
+ TH1F * h1 = new TH1F("hTOFSDigitsTime", "SDigits Time Spectrum in TOF (ns)", 2000, 0., 200) ;
+ h1->Sumw2() ;
+ Add2SDigitsList(h1, 1) ;
+
+ TH2F * h2 = new TH2F("hTOFSDigitsClusMap","SDigits vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ;
+ h2->Sumw2() ;
+ Add2SDigitsList(h2, 2) ;
+
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::MakeHits(TClonesArray * hits)
+{
+ //
+ //make QA data from Hits
+ //
+
+ Int_t in[5];
+ Int_t out[5];
+
+ Int_t nentries=hits->GetEntriesFast();
+ if(nentries<=0) {
+ GetHitsData(0)->Fill(-1.) ;
+ } else{
+ GetHitsData(0)->Fill(TMath::Log10(nentries)) ;
+ }
+ TIter next(hits) ;
+ AliTOFhitT0 * hit ;
+ while ( (hit = dynamic_cast<AliTOFhitT0 *>(next())) ) {
+
+ GetHitsData(1)->Fill( hit->GetTof()*1.E9) ;//in ns
+ GetHitsData(2)->Fill( hit->GetLen()) ;//in cm
+
+ in[0] = hit->GetSector();
+ in[1] = hit->GetPlate();
+ in[2]= hit->GetStrip();
+ in[3]= hit->GetPadx();
+ in[4]= hit->GetPadz();
+ GetMapIndeces(in,out);
+ GetHitsData(3)->Fill( out[0],out[1]) ;//hit map
+ }
+
+}
+
+
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::MakeHits(TTree * hitTree)
+{
+ //
+ // make QA data from Hit Tree
+ //
+ if(!hitTree){
+ AliError("can't get the tree with TOF hits !");
+ return;
+ }
+
+ TBranch * branch = hitTree->GetBranch("TOF") ;
+
+ if (!branch ) {
+ AliError("TOF branch in Hit Tree not found") ;
+ return;
+ }
+
+ TClonesArray * hits = new TClonesArray("AliTOFhitT0", 1000);
+ TClonesArray * dummy = new TClonesArray("AliTOFhitT0", 1000);
+ branch->SetAddress(&dummy);
+ Int_t index = 0 ;
+ for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
+ branch->GetEntry(ientry) ;
+ for (Int_t ihit = 0 ; ihit < dummy->GetEntries() ; ihit++) {
+ AliTOFhitT0 * hit = dynamic_cast<AliTOFhitT0 *> (dummy->At(ihit)) ;
+ new((*hits)[index]) AliTOFhitT0(*hit) ;
+ index++ ;
+ }
+ }
+
+ dummy->Delete();
+ delete dummy;
+ MakeHits(hits) ;
+
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::MakeDigits(TClonesArray * digits)
+{
+ //
+ // makes data from Digits
+ //
+ Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
+ Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
+ Int_t in[5];
+ Int_t out[5];
+
+ Int_t nentries=digits->GetEntriesFast();
+ if(nentries<=0){
+ GetDigitsData(0)->Fill(-1.) ;
+ }else{
+ GetDigitsData(0)->Fill(TMath::Log10(nentries)) ;
+ }
+
+ TIter next(digits) ;
+ AliTOFdigit * digit ;
+ while ( (digit = dynamic_cast<AliTOFdigit *>(next())) ) {
+
+ GetDigitsData(1)->Fill( digit->GetTdc()*tdc2ns) ;//in ns
+ GetDigitsData(2)->Fill( digit->GetToT()*tot2ns) ;//in ns
+
+ in[0] = digit->GetSector();
+ in[1] = digit->GetPlate();
+ in[2] = digit->GetStrip();
+ in[3] = digit->GetPadx();
+ in[4]= digit->GetPadz();
+ GetMapIndeces(in,out);
+ GetDigitsData(3)->Fill( out[0],out[1]) ;//digit map
+ }
+
+}
+
+
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::MakeDigits(TTree * digitTree)
+{
+ //
+ // makes data from Digit Tree
+ //
+ TClonesArray * digits = new TClonesArray("AliTOFdigit", 1000) ;
+
+ TBranch * branch = digitTree->GetBranch("TOF") ;
+ if ( ! branch ) {
+ AliError("TOF branch in Digit Tree not found") ;
+ return;
+ }
+ branch->SetAddress(&digits) ;
+ branch->GetEntry(0) ;
+ MakeDigits(digits) ;
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::MakeSDigits(TClonesArray * sdigits)
+{
+ //
+ // makes data from SDigits
+ //
+
+ Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
+ Int_t in[5];
+ Int_t out[5];
+
+ Int_t nentries=sdigits->GetEntriesFast();
+ if(nentries<=0){
+ GetSDigitsData(0)->Fill(-1.) ;
+ }else{
+ GetSDigitsData(0)->Fill(TMath::Log10(nentries)) ;
+ }
+
+ TIter next(sdigits) ;
+ AliTOFSDigit * sdigit ;
+ while ( (sdigit = dynamic_cast<AliTOFSDigit *>(next())) ) {
+
+ for(Int_t i=0;i<sdigit->GetNDigits();i++){
+ GetSDigitsData(1)->Fill( sdigit->GetTdc(i)*tdc2ns) ;//in ns
+ }
+
+ in[0] = sdigit->GetSector();
+ in[1] = sdigit->GetPlate();
+ in[2] = sdigit->GetStrip();
+ in[3] = sdigit->GetPadx();
+ in[4]= sdigit->GetPadz();
+ GetMapIndeces(in,out);
+ GetSDigitsData(2)->Fill( out[0],out[1]) ;//sdigit map
+ }
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::MakeSDigits(TTree * sdigitTree)
+{
+ //
+ // makes data from SDigit Tree
+ //
+ TClonesArray * sdigits = new TClonesArray("AliTOFSDigit", 1000) ;
+
+ TBranch * branch = sdigitTree->GetBranch("TOF") ;
+ if ( ! branch ) {
+ AliError("TOF branch in SDigit Tree not found") ;
+ return;
+ }
+ branch->SetAddress(&sdigits) ;
+ branch->GetEntry(0) ;
+ MakeSDigits(sdigits) ;
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::StartOfDetectorCycle()
+{
+ //
+ //Detector specific actions at start of cycle
+ //to be implemented
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+{
+ //Detector specific actions at end of cycle
+ // do the QA checking
+
+ AliQAChecker::Instance()->Run(AliQA::kTOF, task, list) ;
+}
+//____________________________________________________________________________
+void AliTOFQADataMakerSim::GetMapIndeces(Int_t* in , Int_t* out)
+{
+ //
+ //return appropriate indeces for the theta-phi map
+ //
+
+ Int_t npadX = AliTOFGeometry::NpadX();
+ Int_t npadZ = AliTOFGeometry::NpadZ();
+ Int_t nStripA = AliTOFGeometry::NStripA();
+ Int_t nStripB = AliTOFGeometry::NStripB();
+ Int_t nStripC = AliTOFGeometry::NStripC();
+
+ Int_t isector = in[0];
+ Int_t iplate = in[1];
+ Int_t istrip = in[2];
+ Int_t ipadX = in[3];
+ Int_t ipadZ = in[4];
+
+ Int_t stripOffset = 0;
+ switch (iplate) {
+ case 0:
+ stripOffset = 0;
+ break;
+ case 1:
+ stripOffset = nStripC;
+ break;
+ case 2:
+ stripOffset = nStripC+nStripB;
+ break;
+ case 3:
+ stripOffset = nStripC+nStripB+nStripA;
+ break;
+ case 4:
+ stripOffset = nStripC+nStripB+nStripA+nStripB;
+ break;
+ default:
+ AliError(Form("Wrong plate number in TOF (%d) !",iplate));
+ break;
+ };
+ Int_t zindex=npadZ*(istrip+stripOffset)+(ipadZ+1);
+ Int_t phiindex=npadX*isector+ipadX+1;
+ out[0]=zindex;
+ out[1]=phiindex;
+
+}
--- /dev/null
+#ifndef AliTOFQADataMakerSim_H
+#define AliTOFQADataMakerSim_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. //
+// S. Arcelli //
+// //
+////////////////////////////////////////////////////////////////////
+
+
+#include "AliQADataMakerSim.h"
+class AliTOFQADataMakerSim: public AliQADataMakerSim {
+
+public:
+ AliTOFQADataMakerSim() ; // ctor
+ AliTOFQADataMakerSim(const AliTOFQADataMakerSim& qadm) ;
+ AliTOFQADataMakerSim& operator = (const AliTOFQADataMakerSim& qadm) ;
+ virtual ~AliTOFQADataMakerSim() {;} // dtor
+
+private:
+ virtual void InitHits() ;
+ virtual void InitDigits() ;
+ virtual void InitSDigits() ;
+ virtual void MakeHits(TClonesArray * hits) ;
+ virtual void MakeHits(TTree * hitTree);
+ virtual void MakeDigits(TClonesArray * digits) ;
+ virtual void MakeDigits(TTree * digTree);
+ virtual void MakeSDigits(TClonesArray * sdigits) ;
+ virtual void MakeSDigits(TTree * sdigTree);
+ virtual void StartOfDetectorCycle() ;
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * list) ;
+ virtual void GetMapIndeces(Int_t *in, Int_t *out) ;
+
+ ClassDef(AliTOFQADataMakerSim,1) // description
+
+};
+
+#endif // AliTOFQADataMakerSim_H
#pragma link C++ class AliTOFpidESD+;
#pragma link C++ class AliTOFReconstructor+;
#pragma link C++ class AliTOFRecoParam;
+#pragma link C++ class AliTOFQADataMakerRec+;
+
#endif
#pragma link C++ class AliTOFT0+;
#pragma link C++ class AliTOFTrigger+;
-#pragma link C++ class AliTOFQADataMaker+;
+#pragma link C++ class AliTOFQADataMakerSim+;
#pragma link C++ class AliTOFQAChecker+;
#endif
# $Id$
SRCS = AliTOFcluster.cxx AliTOFClusterFinder.cxx AliTOFtrack.cxx AliTOFtracker.cxx AliTOFtrackerMI.cxx AliTOFtrackerV1.cxx \
- AliTOFpidESD.cxx AliTOFReconstructor.cxx AliTOFRecoParam.cxx
+ AliTOFpidESD.cxx AliTOFReconstructor.cxx AliTOFRecoParam.cxx AliTOFQADataMakerRec.cxx
HDRS:= $(SRCS:.cxx=.h)
AliTOFDigitMap.cxx \
AliTOFDDLRawData.cxx \
AliTOFT0.cxx AliTOFTrigger.cxx \
- AliTOFQADataMaker.cxx \
+ AliTOFQADataMakerSim.cxx \
AliTOFQAChecker.cxx
HDRS:= $(SRCS:.cxx=.h)
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+/* $Id$ */
+
+////////////////////////////////////////////////////////////////////////////
+// //
+// Produces the data needed to calculate the quality assurance. //
+// All data must be mergeable objects. //
+// //
+// Author: //
+// Sylwester Radomski (radomski@physi.uni-heidelberg.de) //
+// //
+////////////////////////////////////////////////////////////////////////////
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TH1D.h>
+#include <TH2D.h>
+#include <TH3D.h>
+#include <TProfile.h>
+#include <TF1.h>
+#include <TCanvas.h>
+
+// --- AliRoot header files ---
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliTRDcluster.h"
+#include "AliTRDQADataMakerRec.h"
+#include "AliTRDgeometry.h"
+#include "AliTRDdataArrayI.h"
+#include "AliTRDrawStreamTB.h"
+
+#include "AliQAChecker.h"
+
+ClassImp(AliTRDQADataMakerRec)
+
+//____________________________________________________________________________
+ AliTRDQADataMakerRec::AliTRDQADataMakerRec() :
+ AliQADataMakerRec(AliQA::GetDetName(AliQA::kTRD), "TRD Quality Assurance Data Maker")
+{
+ //
+ // Default constructor
+}
+
+//____________________________________________________________________________
+AliTRDQADataMakerRec::AliTRDQADataMakerRec(const AliTRDQADataMakerRec& qadm) :
+ AliQADataMakerRec()
+{
+ //
+ // Copy constructor
+ //
+
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+
+}
+
+//__________________________________________________________________
+AliTRDQADataMakerRec& AliTRDQADataMakerRec::operator=(const AliTRDQADataMakerRec& qadm)
+{
+ //
+ // Equal operator.
+ //
+
+ this->~AliTRDQADataMakerRec();
+ new(this) AliTRDQADataMakerRec(qadm);
+ return *this;
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+{
+ //
+ // Detector specific actions at end of cycle
+ //
+
+ //AliInfo(Form("EndOfCycle", "Fitting RecPoints %d", task));
+
+
+ if (task == AliQA::kRECPOINTS) {
+
+ //list->Print();
+
+ // Rec points full chambers
+ if (((TH2D*)list->At(1))->GetEntries() > 1e4) {
+ for (Int_t i=0; i<540; i++) {
+
+ TH1D *h = ((TH2D*)list->At(1))->ProjectionY(Form("qaTRD_recPoints_amp_%d",i), i+1, i+1);
+ if (h->GetSum() < 100) continue; // chamber not present
+
+ h->Fit("landau", "q0", "goff", 10, 180);
+ TF1 *fit = h->GetFunction("landau");
+ ((TH1D*)list->At(12))->Fill(fit->GetParameter(1));
+ ((TH1D*)list->At(13))->Fill(fit->GetParameter(2));
+ delete h;
+ }
+ }
+
+
+ if (((TH2D*)list->At(10))->GetEntries() > 1e5) {
+ for (Int_t i=0; i<540; i++) {
+
+ TH1D *test = ((TH3D*)list->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, 0, 35);
+ if (test->GetSum() < 100) continue;
+
+ //AliInfo(Form("fitting det = %d", i));
+
+ for(Int_t j=0; j<35; j++) {
+
+ TH1D *h = ((TH3D*)list->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, j+1, j+1);
+ if (h->GetSum() < 50) continue;
+
+ h->Fit("landau", "q0", "goff", 10, 180);
+ TF1 *fit = h->GetFunction("landau");
+
+ Int_t sm = i/18;
+ Int_t det = i%18;
+ TH2D *h2 = (TH2D*)list->At(14+sm);
+ Int_t bin = h2->FindBin(det,j);
+ // printf("%d %d %d\n", det, j, bin);
+ h2->SetBinContent(bin, fit->GetParameter(1));
+ }
+ }
+ }
+ }
+
+ // call the checker
+ AliQAChecker::Instance()->Run(AliQA::kTRD, task, list) ;
+
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerRec::InitESDs()
+{
+ //
+ // Create ESDs histograms in ESDs subdir
+ //
+
+ const Int_t kNhist = 19;
+ TH1 *hist[kNhist];
+ Int_t histoCounter = -1 ;
+
+ hist[++histoCounter] = new TH1D("qaTRD_esd_ntracks", ":Number of tracks", 300, -0.5, 299.5);
+ hist[++histoCounter] = new TH1D("qaTRD_esd_sector", ":Sector", 18, -0.5, 17.7);
+ hist[++histoCounter] = new TH1D("qaTRD_esd_bits", ";Bits", 64, -0.5, 63.5);
+
+ const Int_t knbits = 6;
+ const char *suf[knbits] = {"TPCi", "TPCo", "TPCz", "TRDo", "TRDr", "TRDz"};
+
+ for(Int_t i=0; i<knbits; i++) {
+ hist[++histoCounter] = new TH1D(Form("qaTRD_esd_pt%s",suf[i]), ";p_{T} (GeV/c);", 50, 0, 10);
+ hist[++histoCounter] = new TH1D(Form("qaTRD_esd_trdz%s", suf[i]), ";z (cm)", 200, -400, 400);
+ }
+
+ hist[++histoCounter] = new TH1D("qaTRD_esd_clsTRDo", "TRDo;number of clusters", 130, -0.5, 129.5);;
+ hist[++histoCounter] = new TH1D("qaTRD_esd_clsTRDr", "TRDr;number of clusters", 130, -0.5, 129.5);;
+ hist[++histoCounter] = new TH1D("qaTRD_esd_clsTRDz", "TRDz;number of clusters", 130, -0.5, 129.5);;
+ //hist[++histoCounter] = new TH1D("qaTRD_esd_clsRatio", ";cluster ratio", 100, 0., 1.3);;
+
+ hist[++histoCounter] = new TH2D("qaTRD_esd_sigMom", ";momentum (GeV/c);signal", 100, 0, 5, 200, 0, 1e3);
+
+ for(Int_t i=0; i<=histoCounter; i++) {
+ //hist[i]->Sumw2();
+ Add2ESDsList(hist[i], i);
+ }
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerRec::InitRecPoints()
+{
+ //
+ // Create Reconstructed Points histograms in RecPoints subdir
+ //
+
+ const Int_t kNhist = 14 + 18;
+ TH1 *hist[kNhist];
+
+ hist[0] = new TH1D("qaTRD_recPoints_det", ";Detector ID of the cluster", 540, -0.5, 539.5);
+ hist[1] = new TH2D("qaTRD_recPoints_amp", ";Amplitude", 540, -0.5, 539, 200, -0.5, 199.5);
+ hist[2] = new TH1D("qaTRD_recPoints_npad", ";Number of Pads", 12, -0.5, 11.5);
+
+ hist[3] = new TH1D("qaTRD_recPoints_dist2", ";residuals [2pad]", 100, -1, 1);
+ hist[4] = new TH1D("qaTRD_recPoints_dist3", ";residuals [3pad]", 100, -1, 1);
+ hist[5] = new TH1D("qaTRD_recPoints_dist4", ";residuals [4pad]", 100, -1, 1);
+ hist[6] = new TH1D("qaTRD_recPoints_dist5", ";residuals [5pad]", 100, -1, 1);
+
+ hist[7] = new TH2D("qaTRD_recPoints_rowCol", ";row;col", 16, -0.5, 15.5, 145, -0.5, 144.5);
+ hist[8] = new TH1D("qaTRD_recPoints_time", ";time bin", 35, -0.5, 34.5);
+ hist[9] = new TH1D("qaTRD_recPoints_nCls", ";number of clusters", 500, -0.5, 499.5);
+
+ hist[10] = new TH3D("qaTRD_recPoints_sigTime", ";chamber;time bin;signal",
+ 540, -0.5, 539.5, 35, -0.5, 34.5, 100, 0, 200);
+ hist[11] = new TProfile("qaTRD_recPoints_prf", ";distance;center of gravity"
+ , 120, -0.6, 0.6, -1.2, 1.2, "");
+
+ hist[12] = new TH1D("qaTRD_recPoints_ampMPV", ";amplitude MPV", 100, 0, 100);
+ hist[13] = new TH1D("qaTRD_recPoints_ampSigma", ";amplitude Sigma", 100, 0, 100);
+
+ for(Int_t i=0; i<18; i++) {
+ hist[14+i] = new TH2D(Form("qaTRD_recPoints_sigTime_sm%d",i), Form("sm%d;det;time bin"),
+ 30, -0.5, 29.5, 35, -0.5, 34.5);
+ hist[14+i]->SetMinimum(20);
+ hist[14+i]->SetMaximum(40);
+ }
+
+ for(Int_t i=0; i<kNhist; i++) {
+ //hist[i]->Sumw2();
+ Add2RecPointsList(hist[i], i);
+ }
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerRec::InitRaws()
+{
+ //
+ // create Raws histograms in Raws subdir
+ //
+
+ const Int_t kSM = 18;
+ //const Int_t kNCh = 540;
+ const Int_t kNhist = 4+kSM;
+ TH1D *hist[kNhist];
+
+ // four histograms to be published
+ hist[0] = new TH1D("qaTRD_raws_det", ";detector", 540, -0.5, 539.5);
+ hist[1] = new TH1D("qaTRD_raws_sig", ";signal", 100, -0.5, 99.5);
+ hist[2] = new TH1D("qaTRD_raws_timeBin", ";time bin", 40, -0.5, 39.5);
+ hist[3] = new TH1D("qaTRD_raws_smId", ";supermodule", 18, -0.5, 17.5);
+ //
+
+ // one double per MCM (not published)
+ const Int_t kNMCM = 30 * 8 * 16;
+ for(Int_t i=0; i<kSM; i++)
+ hist[4+i] = new TH1D(Form("qaTRD_raws_sm%d",i),"",kNMCM, -0.5, kNMCM-0.5);
+
+ // register
+ for(Int_t i=0; i<kNhist; i++) {
+ //hist[i]->Sumw2();
+ Add2RawsList(hist[i], i);
+ }
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerRec::MakeESDs(AliESDEvent * esd)
+{
+ //
+ // Make QA data from ESDs
+ //
+
+ Int_t nTracks = esd->GetNumberOfTracks();
+ GetESDsData(0)->Fill(nTracks);
+
+ // track loop
+ for (Int_t i=0; i<nTracks; i++) {
+
+ AliESDtrack *track = esd->GetTrack(i);
+ const AliExternalTrackParam *paramOut = track->GetOuterParam();
+ const AliExternalTrackParam *paramIn = track->GetInnerParam();
+
+ // long track ..
+ if (!paramIn) continue;
+ if (!paramOut) continue;
+
+ // not a kink
+ if (track->GetKinkIndex(0) > 0) continue;
+
+ Double_t extZ = GetExtZ(paramIn);
+ if (TMath::Abs(extZ) > 320) continue; // acceptance cut
+
+ // .. in the acceptance
+ Int_t sector = GetSector(paramOut->GetAlpha());
+ GetESDsData(1)->Fill(sector);
+
+ UInt_t u = 1;
+ UInt_t status = track->GetStatus();
+ for(Int_t bit=0; bit<32; bit++)
+ if (u<<bit & status) GetESDsData(2)->Fill(bit);
+
+ const Int_t knbits = 6;
+ Int_t bit[6] = {0,0,0,0,0,0};
+ bit[0] = status & AliESDtrack::kTPCin;
+ bit[1] = status & AliESDtrack::kTPCout;
+ bit[2] = (status & AliESDtrack::kTPCout) && !(status & AliESDtrack::kTRDout);
+ bit[3] = status & AliESDtrack::kTRDout;
+ bit[4] = status & AliESDtrack::kTRDrefit;
+ bit[5] = (status & AliESDtrack::kTRDout) && !(status & AliESDtrack::kTRDrefit);
+
+ // transverse momentum
+ //const Double_t *val = paramOut->GetParameter(); // parameters at the Outer plane
+ Double_t pt = paramOut->Pt(); //1./TMath::Abs(val[4]);
+
+ for(Int_t b=0; b<knbits; b++) {
+ if (bit[b]) {
+ GetESDsData(2*b+3)->Fill(pt);
+ GetESDsData(2*b+4)->Fill(extZ);
+ }
+ }
+
+ // clusters
+ for(Int_t b=0; b<3; b++)
+ if (bit[3+b]) GetESDsData(b+15)->Fill(track->GetTRDncls());
+
+ // refitted only
+ if (!bit[4]) continue;
+
+ //fQuality->Fill(track->GetTRDQuality());
+ //fBudget->Fill(track->GetTRDBudget());
+ //fSignal->Fill(track->GetTRDsignal());
+
+ GetESDsData(18)->Fill(track->GetP(), track->GetTRDsignal());
+
+ /*
+ // PID only
+ if (status & AliESDtrack::kTRDpid) {
+
+ for(Int_t l=0; l<6; l++) fTime->Fill(track->GetTRDTimBin(l));
+
+ // fill pid histograms
+ Double_t trdr0 = 0; //, tpcr0 = 0;
+ Int_t trdBestPid = 5; //, tpcBestPid = 5; // charged
+ const Double_t kminPidValue = 0.9;
+
+ //Double_t pp[5];
+ //track->GetTPCpid(pp); // ESD inconsequence
+
+ for(Int_t pid=0; pid<5; pid++) {
+
+ trdr0 += track->GetTRDpid(pid);
+ //tpcr0 += pp[pid];
+
+ fTrdPID[pid]->Fill(track->GetTRDpid(pid));
+ //fTpcPID[pid]->Fill(pp[pid]);
+
+ if (track->GetTRDpid(pid) > kminPidValue) trdBestPid = pid;
+ //if (pp[pid] > kminPidValue) tpcBestPid = pid;
+ }
+
+ fTrdPID[5]->Fill(trdr0); // check unitarity
+ fTrdSigMomPID[trdBestPid]->Fill(track->GetP(), track->GetTRDsignal());
+
+ //fTpcPID[5]->Fill(tpcr0); // check unitarity
+ //fTpcSigMomPID[tpcBestPid]->Fill(track->GetP(), track->GetTPCsignal());
+ }
+ */
+
+ }
+
+}
+
+//______________________________________________________________________________
+Int_t AliTRDQADataMakerRec::GetSector(const Double_t alpha) const
+{
+ //
+ // Gets the sector number
+ //
+
+ Double_t size = TMath::DegToRad() * 20.; // shall use TRDgeo
+ Int_t sector = (Int_t)((alpha + TMath::Pi())/size);
+ return sector;
+
+}
+
+//______________________________________________________________________________
+Double_t AliTRDQADataMakerRec::GetExtZ(const AliExternalTrackParam *in) const
+{
+ //
+ // Returns the Z position at the entry to TRD
+ // using parameters from the TPC in
+ //
+
+ const Double_t kX0 = 300;
+
+ Double_t x = in->GetX();
+ const Double_t *par = in->GetParameter();
+ Double_t theta = par[3];
+ Double_t z = in->GetZ();
+
+ Double_t zz = z + (kX0-x) * TMath::Tan(theta);
+ return zz;
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerRec::MakeRaws(AliRawReader* rawReader)
+{
+ //
+ // Makes QA data from raw data
+ //
+
+ // 157
+ // T9 -- T10
+
+ //const Int_t kSM = 18;
+ //const Int_t kROC = 30;
+ const Int_t kROB = 8;
+ //const Int_t kLayer = 6;
+ //const Int_t kStack = 5;
+ const Int_t kMCM = 16;
+ // const Int_t kADC = 22;
+
+ AliTRDrawStreamTB *raw = new AliTRDrawStreamTB(rawReader);
+
+ raw->SetRawVersion(3);
+ raw->Init();
+
+ while (raw->Next()) {
+
+ GetRawsData(0)->Fill(raw->GetDet());
+
+ // possibly needs changes with the new reader !!
+ Int_t *sig = raw->GetSignals();
+ for(Int_t i=0; i<3; i++) GetRawsData(1)->Fill(sig[i]);
+ // ---
+
+ GetRawsData(2)->Fill(raw->GetTimeBin());
+
+ // calculate the index;
+ Int_t sm = raw->GetSM();
+ Int_t roc = raw->GetROC();
+ Int_t rob = raw->GetROB();
+ Int_t mcm = raw->GetMCM();
+ //Int_t adc = raw->GetADC();
+
+ //Int_t index = roc * (kROB*kMCM*kADC) + rob * (kMCM*kADC) + mcm * kADC + adc;
+ Int_t index = roc * (kROB*kMCM) + rob * kMCM + mcm;
+ GetRawsData(3)->Fill(sm);
+ GetRawsData(4+sm)->Fill(index);
+ }
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
+{
+ //
+ // Makes data from RecPoints
+ //
+
+ Int_t nsize = Int_t(clustersTree->GetTotBytes() / (sizeof(AliTRDcluster)));
+ TObjArray *clusterArray = new TObjArray(nsize+1000);
+
+ TBranch *branch = clustersTree->GetBranch("TRDcluster");
+ if (!branch) {
+ AliError("Can't get the branch !");
+ return;
+ }
+ branch->SetAddress(&clusterArray);
+
+ // Loop through all entries in the tree
+ Int_t nEntries = (Int_t) clustersTree->GetEntries();
+ Int_t nbytes = 0;
+ AliTRDcluster *c = 0;
+ Int_t nDet[540];
+ for (Int_t i=0; i<540; i++) nDet[i] = 0;
+
+ for (Int_t iEntry = 0; iEntry < nEntries; iEntry++) {
+
+ // Import the tree
+ nbytes += clustersTree->GetEvent(iEntry);
+
+ // Get the number of points in the detector
+ Int_t nCluster = clusterArray->GetEntriesFast();
+
+ // Loop through all TRD digits
+ for (Int_t iCluster = 0; iCluster < nCluster; iCluster++) {
+ c = (AliTRDcluster *) clusterArray->UncheckedAt(iCluster);
+
+ Int_t iDet = c->GetDetector();
+ nDet[iDet]++;
+ GetRecPointsData(0)->Fill(iDet);
+ GetRecPointsData(1)->Fill(iDet, c->GetQ());
+ GetRecPointsData(2)->Fill(c->GetNPads());
+ if (c->GetNPads() < 6)
+ GetRecPointsData(1+c->GetNPads())->Fill(c->GetCenter());
+
+ //if (c->GetPadTime() < 5)
+ ((TH2D*)GetRecPointsData(7))->Fill(c->GetPadRow(), c->GetPadCol());
+ GetRecPointsData(8)->Fill(c->GetPadTime());
+
+ ((TH3D*)GetRecPointsData(10))->Fill(iDet, c->GetPadTime(), c->GetQ());
+
+ // PRF for 2pad
+ //if (c->GetNPads() == 2) {
+ Short_t *sig = c->GetSignals();
+ Double_t frac = -10;
+
+ if (sig[0] == 0 && sig[1] == 0 && sig[2] == 0 && sig[5] == 0 && sig[6] == 0)
+ frac = 1. * sig[4] / (sig[3] + sig[4]);
+
+ if (sig[0] == 0 && sig[1] == 0 && sig[4] == 0 && sig[5] == 0 && sig[6] == 0)
+ frac = -1. * sig[2] / (sig[2] + sig[3]);
+
+ if (frac > -10) ((TProfile*)GetRecPointsData(11))->Fill(c->GetCenter(), frac);
+
+ //}
+ }
+ }
+
+ for(Int_t i=0; i<540; i++)
+ if (nDet[i] > 0) GetRecPointsData(9)->Fill(nDet[i]);
+
+ delete clusterArray;
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerRec::StartOfDetectorCycle()
+{
+ //
+ // Detector specific actions at start of cycle
+ //
+
+}
+
+//__________________________________________________________________________
+Int_t AliTRDQADataMakerRec::CheckPointer(TObject *obj, const char *name)
+{
+ //
+ // Checks initialization of pointers
+ //
+
+ if (!obj) AliWarning(Form("null pointer: %s", name));
+ return !!obj;
+
+}
--- /dev/null
+#ifndef AliTRDQADataMakerRec_H
+#define AliTRDQADataMakerRec_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+////////////////////////////////////////////////////////////////////////////
+// //
+// Produces the data needed to calculate the quality assurance. //
+// All data must be mergeable objects. //
+// //
+// Author: //
+// Sylwester Radomski (radomski@physi.uni-heidelberg.de) //
+// //
+////////////////////////////////////////////////////////////////////////////
+
+// --- ROOT system ---
+class TH1F ;
+class TH1I ;
+
+// --- AliRoot header files ---
+class AliExternalTrackParam;
+
+#include "AliQADataMakerRec.h"
+
+class AliTRDQADataMakerRec: public AliQADataMakerRec {
+
+ public:
+
+ AliTRDQADataMakerRec() ; // ctor
+ AliTRDQADataMakerRec(const AliTRDQADataMakerRec& qadm) ;
+ AliTRDQADataMakerRec& operator = (const AliTRDQADataMakerRec& qadm) ;
+ virtual ~AliTRDQADataMakerRec() {;} // dtor
+
+ private:
+
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list) ;
+ virtual void InitESDs() ;
+ virtual void InitRecPoints() ;
+ virtual void InitRaws() ;
+
+ virtual void MakeRaws(AliRawReader* rawReader);
+ virtual void MakeRecPoints(TTree * recpo);
+ virtual void MakeESDs(AliESDEvent * esd);
+
+ virtual void StartOfDetectorCycle() ;
+ Int_t CheckPointer(TObject *obj, const char *name);
+
+ // internal methods
+ Int_t GetSector(const Double_t alpha) const;
+ Double_t GetExtZ(const AliExternalTrackParam *paramIn) const;
+
+ ClassDef(AliTRDQADataMakerRec,1) // Creates the TRD QA data
+
+};
+#endif // AliTRDQADataMakerRec_H
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+/* $Id$ */
+
+////////////////////////////////////////////////////////////////////////////
+// //
+// Produces the data needed to calculate the quality assurance. //
+// All data must be mergeable objects. //
+// //
+// Author: //
+// Sylwester Radomski (radomski@physi.uni-heidelberg.de) //
+// //
+////////////////////////////////////////////////////////////////////////////
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TH1D.h>
+#include <TH2D.h>
+#include <TH3D.h>
+#include <TProfile.h>
+#include <TF1.h>
+#include <TCanvas.h>
+#include <TTree.h>
+
+// --- AliRoot header files ---
+//#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliTRDdigit.h"
+#include "AliTRDhit.h"
+//#include "AliTRDcluster.h"
+#include "AliTRDQADataMakerSim.h"
+#include "AliTRDdigitsManager.h"
+#include "AliTRDgeometry.h"
+#include "AliTRDdataArrayI.h"
+//#include "AliTRDrawStreamTB.h"
+
+#include "AliQAChecker.h"
+
+ClassImp(AliTRDQADataMakerSim)
+
+//____________________________________________________________________________
+ AliTRDQADataMakerSim::AliTRDQADataMakerSim() :
+ AliQADataMakerSim(AliQA::GetDetName(AliQA::kTRD), "TRD Quality Assurance Data Maker")
+{
+ //
+ // Default constructor
+}
+
+//____________________________________________________________________________
+AliTRDQADataMakerSim::AliTRDQADataMakerSim(const AliTRDQADataMakerSim& qadm) :
+ AliQADataMakerSim()
+{
+ //
+ // Copy constructor
+ //
+
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+
+}
+
+//__________________________________________________________________
+AliTRDQADataMakerSim& AliTRDQADataMakerSim::operator=(const AliTRDQADataMakerSim& qadm)
+{
+ //
+ // Equal operator.
+ //
+
+ this->~AliTRDQADataMakerSim();
+ new(this) AliTRDQADataMakerSim(qadm);
+ return *this;
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+{
+ //
+ // Detector specific actions at end of cycle
+ //
+
+ //AliInfo(Form("EndOfCycle", "Fitting RecPoints %d", task));
+
+ // call the checker
+ AliQAChecker::Instance()->Run(AliQA::kTRD, task, list) ;
+
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::InitHits()
+{
+ //
+ // Create Hits histograms in Hits subdir
+ //
+
+ const Int_t kNhist = 4;
+ TH1D *hist[kNhist];
+
+ hist[0] = new TH1D("qaTRD_hits_det", ";Detector Id of the hit", 540, -0.5, 539.5) ;
+
+ hist[1] = new TH1D("qaTRD_hist_Qdrift", ";Charge from tracks", 100, 0, 100);
+ hist[2] = new TH1D("qaTRD_hist_Qamp", ";Charge from TRD photon", 100, 0, 100);
+ hist[3] = new TH1D("qaTRD_hist_Qphoton", ";Charge from TRD photon", 100, 0, 100);
+
+ for(Int_t i=0; i<kNhist; i++) {
+ //hist[i]->Sumw2();
+ Add2HitsList(hist[i], i);
+ }
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::InitDigits()
+{
+ //
+ // Create Digits histograms in Digits subdir
+ //
+
+ const Int_t kNhist = 3;
+ TH1D *hist[kNhist];
+
+ hist[0] = new TH1D("qaTRD_digits_det", ";Detector Id of the digit", 540, -0.5, 539.5);
+ hist[1] = new TH1D("qaTRD_digits_time", ";Time bin", 40, -0.5, 39.5);
+ hist[2] = new TH1D("qaTRD_digits_amp", ";Amplitude", 100, 0, 100.);
+
+ for(Int_t i=0; i<kNhist; i++) {
+ hist[i]->Sumw2();
+ Add2DigitsList(hist[i], i);
+ }
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::InitSDigits()
+{
+ //
+ // Create SDigits histograms in SDigits subdir
+ //
+
+ const Int_t kNhist = 3;
+ TH1D *hist[kNhist];
+
+ hist[0] = new TH1D("qaTRD_sdigits_det", ";Detector Id of the digit", 540, -0.5, 539.5);
+ hist[1] = new TH1D("qaTRD_sdigits_time", ";Time bin", 40, -0.5, 39.5);
+ hist[2] = new TH1D("qaTRD_sdigits_amp", ";Amplitude", 100, 0, 1e7);
+
+ for(Int_t i=0; i<kNhist; i++) {
+ hist[i]->Sumw2();
+ Add2SDigitsList(hist[i], i);
+ }
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::MakeHits(TClonesArray * hits)
+{
+ //
+ // Make QA data from Hits
+ //
+
+ TIter next(hits);
+ AliTRDhit * hit;
+
+ while ( (hit = dynamic_cast<AliTRDhit *>(next())) ) {
+ GetHitsData(0)->Fill(hit->GetDetector());
+ Double_t q = TMath::Abs(hit->GetCharge());
+
+ if (hit->FromDrift()) GetHitsData(1)->Fill(q);
+ if (hit->FromAmplification()) GetHitsData(2)->Fill(q);
+ if (hit->FromTRphoton()) GetHitsData(3)->Fill(q);
+ }
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::MakeHits(TTree * hitTree)
+{
+ //
+ // Make QA data from Hits
+ //
+
+ if (!CheckPointer(hitTree, "TRD hits tree")) return;
+
+ TBranch *branch = hitTree->GetBranch("TRD");
+ if (!CheckPointer(branch, "TRD hits branch")) return;
+
+ Int_t nhits = (Int_t)(hitTree->GetTotBytes()/sizeof(AliTRDhit));
+ TClonesArray *hits = new TClonesArray("AliTRDhit", nhits+1000);
+ TClonesArray *tmp = new TClonesArray("AliTRDhit", 1000);
+ branch->SetAddress(&tmp);
+
+ Int_t index = 0;
+ Int_t nEntries = (Int_t)branch->GetEntries();
+ for(Int_t i = 0; i < nEntries; i++) {
+ branch->GetEntry(i);
+ Int_t nHits = (Int_t)tmp->GetEntries();
+ for(Int_t j=0; j<nHits; j++) {
+ AliTRDhit *hit = (AliTRDhit*)tmp->At(j);
+ new((*hits)[index++]) AliTRDhit(*hit);
+ }
+ }
+
+ tmp->Delete();
+ delete tmp;
+ MakeHits(hits);
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::MakeDigits(TClonesArray * digits)
+{
+ //
+ // Makes data from Digits
+ //
+
+ TIter next(digits) ;
+ AliTRDdigit * digit ;
+ while ( (digit = dynamic_cast<AliTRDdigit *>(next())) ) {
+ GetDigitsData(0)->Fill(digit->GetDetector());
+ GetDigitsData(1)->Fill(digit->GetTime());
+ GetDigitsData(2)->Fill(digit->GetAmp());
+ }
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::MakeDigits(TTree * digits)
+{
+ //
+ // Makes data from digits tree
+ //
+
+ AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
+ digitsManager->CreateArrays();
+ digitsManager->ReadDigits(digits);
+
+ for (Int_t i = 0; i < AliTRDgeometry::kNdet; i++) {
+
+ AliTRDdataArrayI *digitsIn = digitsManager->GetDigits(i);
+
+ // This is to take care of switched off super modules
+ if (digitsIn->GetNtime() == 0) continue;
+
+ digitsIn->Expand();
+
+ //AliTRDSignalIndex* indexes = digitsManager->GetIndexes(i);
+ //if (indexes->IsAllocated() == kFALSE) digitsManager->BuildIndexes(i);
+
+ Int_t nRows = digitsIn->GetNrow();
+ Int_t nCols = digitsIn->GetNcol();
+ Int_t nTbins = digitsIn->GetNtime();
+
+ for(Int_t row = 0; row < nRows; row++)
+ for(Int_t col = 0; col < nCols; col++)
+ for(Int_t time = 0; time < nTbins; time++) {
+
+ Float_t signal = digitsIn->GetDataUnchecked(row,col,time);
+ GetDigitsData(0)->Fill(i);
+ GetDigitsData(1)->Fill(time);
+ GetDigitsData(2)->Fill(signal);
+ }
+
+ //delete digitsIn;
+ }
+
+ delete digitsManager;
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::MakeSDigits(TClonesArray * sdigits)
+{
+ //
+ // Makes data from Digits
+ //
+
+ TIter next(sdigits) ;
+ AliTRDdigit * digit ;
+ while ( (digit = dynamic_cast<AliTRDdigit *>(next())) ) {
+ GetDigitsData(0)->Fill(digit->GetDetector());
+ GetDigitsData(1)->Fill(digit->GetTime());
+ GetDigitsData(2)->Fill(digit->GetAmp());
+ }
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::MakeSDigits(TTree * digits)
+{
+ //
+ // Makes data from SDigits
+ //
+
+ AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
+ digitsManager->CreateArrays();
+ digitsManager->ReadDigits(digits);
+
+ for (Int_t i = 0; i < AliTRDgeometry::kNdet; i++) {
+
+ AliTRDdataArrayI *digitsIn = digitsManager->GetDigits(i);
+
+ // This is to take care of switched off super modules
+ if (digitsIn->GetNtime() == 0) continue;
+
+ digitsIn->Expand();
+
+ //AliTRDSignalIndex* indexes = digitsManager->GetIndexes(i);
+ //if (indexes->IsAllocated() == kFALSE) digitsManager->BuildIndexes(i);
+
+ Int_t nRows = digitsIn->GetNrow();
+ Int_t nCols = digitsIn->GetNcol();
+ Int_t nTbins = digitsIn->GetNtime();
+
+ for(Int_t row = 0; row < nRows; row++)
+ for(Int_t col = 0; col < nCols; col++)
+ for(Int_t time = 0; time < nTbins; time++) {
+
+ Float_t signal = digitsIn->GetDataUnchecked(row,col,time);
+ if (signal <= 0) continue;
+ GetSDigitsData(0)->Fill(i);
+ GetSDigitsData(1)->Fill(time);
+ GetSDigitsData(2)->Fill(signal);
+ }
+
+ // delete digitsIn;
+ }
+
+ delete digitsManager;
+
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::StartOfDetectorCycle()
+{
+ //
+ // Detector specific actions at start of cycle
+ //
+
+}
+
+//__________________________________________________________________________
+Int_t AliTRDQADataMakerSim::CheckPointer(TObject *obj, const char *name)
+{
+ //
+ // Checks initialization of pointers
+ //
+
+ if (!obj) AliWarning(Form("null pointer: %s", name));
+ return !!obj;
+
+}
--- /dev/null
+#ifndef AliTRDQADataMakerSim_H
+#define AliTRDQADataMakerSim_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+////////////////////////////////////////////////////////////////////////////
+// //
+// Produces the data needed to calculate the quality assurance. //
+// All data must be mergeable objects. //
+// //
+// Author: //
+// Sylwester Radomski (radomski@physi.uni-heidelberg.de) //
+// //
+////////////////////////////////////////////////////////////////////////////
+
+// --- ROOT system ---
+class TH1F ;
+class TH1I ;
+
+// --- AliRoot header files ---
+class AliExternalTrackParam;
+
+#include "AliQADataMakerSim.h"
+
+class AliTRDQADataMakerSim: public AliQADataMakerSim {
+
+ public:
+
+ AliTRDQADataMakerSim() ; // ctor
+ AliTRDQADataMakerSim(const AliTRDQADataMakerSim& qadm) ;
+ AliTRDQADataMakerSim& operator = (const AliTRDQADataMakerSim& qadm) ;
+ virtual ~AliTRDQADataMakerSim() {;} // dtor
+
+ private:
+
+ virtual void EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list) ;
+ virtual void InitHits() ;
+ virtual void InitDigits() ;
+ virtual void InitSDigits() ;
+
+ virtual void MakeHits(TTree * hitTree);
+ virtual void MakeHits(TClonesArray * hits);
+
+ virtual void MakeSDigits(TTree *sdigitTree);
+ virtual void MakeSDigits(TClonesArray * sigits);
+
+ virtual void MakeDigits(TTree *digitTree);
+ virtual void MakeDigits(TClonesArray * digits);
+
+ virtual void StartOfDetectorCycle() ;
+ Int_t CheckPointer(TObject *obj, const char *name);
+
+ ClassDef(AliTRDQADataMakerSim,1) // Creates the TRD QA data
+
+};
+#endif // AliTRDQADataMakerSim_H
#pragma link C++ class AliTRDalignment+;
#pragma link C++ class AliTRDQAChecker+;
-#pragma link C++ class AliTRDQADataMaker+;
#pragma link C++ class AliTRDCalibraFillHisto+;
#pragma link C++ class AliTRDCalibraFit+;
#pragma link C++ class AliTRDtrackerV1+;
#pragma link C++ class AliTRDstackLayer+;
#pragma link C++ class AliTRDtrackerFitter+;
+#pragma link C++ class AliTRDQADataMakerRec+;
#endif
#pragma link C++ class AliTRDmcTrack+;
#pragma link C++ class AliTRDdigitizer+;
#pragma link C++ class AliTRDSimParam+;
+#pragma link C++ class AliTRDQADataMakerSim+;
#endif
AliTRDCalibraVdriftLinearFit.cxx \
AliTRDCalibPadStatus.cxx \
AliTRDQAChecker.cxx \
- AliTRDQADataMaker.cxx \
AliTRDPreprocessor.cxx \
AliTRDDataDCS.cxx \
AliTRDSensor.cxx \
AliTRDtrackerV1.cxx \
AliTRDpropagationLayer.cxx \
AliTRDstackLayer.cxx \
- AliTRDtrackerFitter.cxx
+ AliTRDtrackerFitter.cxx \
+ AliTRDQADataMakerRec.cxx
HDRS= $(SRCS:.cxx=.h)
AliTRDv1.cxx \
AliTRDmcTrack.cxx \
AliTRDSimParam.cxx \
- AliTRDdigitizer.cxx
+ AliTRDdigitizer.cxx \
+ AliTRDQADataMakerSim.cxx
HDRS= $(SRCS:.cxx=.h)