1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 // --- ROOT system ---
18 #include <TClonesArray.h>
23 #include <TLorentzVector.h>
25 // --- AliRoot header files ---
26 #include "AliESDEvent.h"
28 #include "AliRawReader.h"
29 #include "AliQAChecker.h"
30 #include "AliMUONCluster.h"
31 #include "AliMUONRawStreamTracker.h"
32 #include "AliMUONRawStreamTrigger.h"
34 #include "AliMUONVClusterStore.h"
35 #include "AliMUONVCluster.h"
36 #include "AliESDMuonTrack.h"
38 #include "AliMUONQADataMakerRec.h"
40 //-----------------------------------------------------------------------------
41 /// \class AliMUONQADataMakerRec
43 /// MUON base class for quality assurance data (histo) maker
48 ClassImp(AliMUONQADataMakerRec)
51 //____________________________________________________________________________
52 AliMUONQADataMakerRec::AliMUONQADataMakerRec() :
53 AliQADataMakerRec(AliQA::GetDetName(AliQA::kMUON), "MUON Quality Assurance Data Maker"),
59 //____________________________________________________________________________
60 AliMUONQADataMakerRec::AliMUONQADataMakerRec(const AliMUONQADataMakerRec& qadm) :
64 SetName((const char*)qadm.GetName()) ;
65 SetTitle((const char*)qadm.GetTitle());
68 //__________________________________________________________________
69 AliMUONQADataMakerRec& AliMUONQADataMakerRec::operator = (const AliMUONQADataMakerRec& qadm )
72 this->~AliMUONQADataMakerRec();
73 new(this) AliMUONQADataMakerRec(qadm);
77 //__________________________________________________________________
78 AliMUONQADataMakerRec::~AliMUONQADataMakerRec()
84 //____________________________________________________________________________
85 void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray* list)
87 ///Detector specific actions at end of cycle
89 AliQAChecker::Instance()->Run(AliQA::kMUON, task, list) ;
92 //____________________________________________________________________________
93 void AliMUONQADataMakerRec::InitRaws()
95 /// create Raws histograms in Raws subdir
96 TH1I* h0 = new TH1I("hRawBusPatch", "buspatch distribution", 1932, 1, 1932);
99 TH1I* h1 = new TH1I("hRawCharge", "Charge distribution in rawdata", 4096, 0, 4095);
104 //____________________________________________________________________________
105 void AliMUONQADataMakerRec::InitRecPoints()
107 /// create Reconstructed Points histograms in RecPoints subdir
108 TH1F* h0 = new TH1F("hClusterCharge", "Clusters Charge distribution", 1000, 0., 4095.);
109 Add2RecPointsList(h0, 0);
111 TH1I* h1 = new TH1I("hClusterDetElem", "DetElemId distribution in Clusters ", 1000, 100., 1100.);
112 Add2RecPointsList(h1, 1);
116 //____________________________________________________________________________
117 void AliMUONQADataMakerRec::InitESDs()
119 ///create ESDs histograms in ESDs subdir
120 TH1F* h0 = new TH1F("hESDnTracks", "ESDs track number distribution", 30, 0., 30.);
123 TH1F* h1 = new TH1F("hESDMomentum", "ESDs P distribution", 300, 0., 300) ;
126 TH1F* h2 = new TH1F("hESDPt", "ESDs Pt distribution", 200, 0., 50) ;
127 Add2ESDsList(h2, 2) ;
129 TH1F* h3 = new TH1F("hESDRapidity", "ESDs rapidity distribution", 200, -4.5,-2.) ;
130 Add2ESDsList(h3, 3) ;
133 //____________________________________________________________________________
134 void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
136 /// make QA for rawdata
143 AliMUONRawStreamTracker rawStream(rawReader);
145 while( rawStream.Next(busPatchId, manuId, channelId, charge) ) {
147 GetRawsData(0)->Fill(busPatchId);
148 GetRawsData(1)->Fill(charge);
154 //____________________________________________________________________________
155 void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree)
158 /// makes data from RecPoints
160 fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
161 fClusterStore->Connect(*clustersTree, false);
162 clustersTree->GetEvent(0);
164 TIter next(fClusterStore->CreateIterator());
166 AliMUONVCluster* clus = 0x0;
168 while ( ( clus = static_cast<AliMUONVCluster*>(next()) ) )
170 GetRecPointsData(0)->Fill(clus->GetCharge());
171 GetRecPointsData(1)->Fill(clus->GetDetElemId());
175 //____________________________________________________________________________
176 void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd)
178 /// make QA data from ESDs
182 Int_t nTracks = (Int_t)esd->GetNumberOfMuonTracks() ;
183 GetESDsData(0)->Fill(nTracks);
185 for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
187 AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iTrack);
188 muonTrack->LorentzP(v1);
190 GetESDsData(1)->Fill(v1.P());
191 GetESDsData(2)->Fill(v1.Pt());
192 GetESDsData(3)->Fill(v1.Rapidity());
196 //____________________________________________________________________________
197 void AliMUONQADataMakerRec::StartOfDetectorCycle()
199 /// Detector specific actions at start of cycle