/*
$Log$
+Revision 1.6 2001/01/26 21:50:43 morsch
+Use access functions to AliMUONHit member data.
+
+Revision 1.5 2001/01/26 20:00:53 hristov
+Major upgrade of AliRoot code
+
+Revision 1.4 2000/12/21 22:14:38 morsch
+Clean-up of coding rule violations.
+
+Revision 1.3 2000/12/21 17:51:54 morsch
+RN3 violations corrected
+
+Revision 1.2 2000/11/23 10:09:39 gosset
+Bug correction in AliMUONRecoDisplay.
+Copyright, $Log$
+Copyright, Revision 1.6 2001/01/26 21:50:43 morsch
+Copyright, Use access functions to AliMUONHit member data.
+Copyright,
+Copyright, Revision 1.5 2001/01/26 20:00:53 hristov
+Copyright, Major upgrade of AliRoot code
+Copyright,
+Copyright, Revision 1.4 2000/12/21 22:14:38 morsch
+Copyright, Clean-up of coding rule violations.
+Copyright,
+Copyright, Revision 1.3 2000/12/21 17:51:54 morsch
+Copyright, RN3 violations corrected
+Copyright,, $Id$, comments at the right place for automatic documentation,
+in AliMUONRecoEvent and AliMUONRecoDisplay
+
*/
//Authors: Mihaela Gheata, Andrei Gheata 09/10/00
#include <TClonesArray.h>
#include "AliMUONRecoEvent.h"
#include "AliMUONRecoDisplay.h"
+#include "AliHeader.h"
#include <TROOT.h>
#include <AliPoints.h>
#include <TSlider.h>
fEvGen = new AliMUONRecoEvent();
- TFile *galice_file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
- galice_file->cd();
+ TFile *galiceFile = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
+ galiceFile->cd();
if (nevent > gAlice->TreeE()->GetEntries() - 1) {
cout << "Event number out of range !\n";
gApplication->Terminate(0);
//-------------------------------------------------------------------
Bool_t AliMUONRecoDisplay::Event(Int_t nevent)
{
+// Go to event nevent
fEvent = nevent;
for (Int_t entry=0; entry<fTree->GetEntries(); entry++) {
fTree->GetEntry(entry);
if (fEvGen) fEvGen->Clear();
fEvGen->SetNoEvent(nevent);
// get list of particles
- TClonesArray *Particles = gAlice->Particles();
// connect MUON module
- AliDetector *MUON = gAlice->GetDetector("MUON");
- if (!MUON) {
+ AliDetector *pMUON = gAlice->GetDetector("MUON");
+ if (!pMUON) {
cout << "MUON module not present.\n";
gApplication->Terminate(0);
}
Int_t ch;
// loop all tracks
for (Int_t track=0; track<ntracks; track++) {
- hit = (AliMUONHit *) MUON->FirstHit(track);
+ hit = (AliMUONHit *) pMUON->FirstHit(track);
if (!hit) continue;
- particle = (TParticle *) Particles->UncheckedAt(hit->Track());
+ particle = gAlice->Particle(hit->Track());
if (IsReconstructible(track) && TMath::Abs(particle->GetPdgCode())==13) {
gtrack = fEvGen->AddEmptyTrack();
gtrack->SetSign(TMath::Sign((Int_t)1, -particle->GetPdgCode()));
// reset hits
for (ch=0; ch<10; ch++) gtrack->SetHitPosition(ch,0,0,0);
// loop all hits
- for (AliMUONHit *muonHit=(AliMUONHit*)MUON->FirstHit(track);
+ for (AliMUONHit *muonHit=(AliMUONHit*)pMUON->FirstHit(track);
muonHit;
- muonHit=(AliMUONHit*)MUON->NextHit()) {
- ch = muonHit->fChamber - 1;
+ muonHit=(AliMUONHit*)pMUON->NextHit()) {
+ ch = muonHit->Chamber() - 1;
if (ch<0 || ch>9) continue;
gtrack->SetHitPosition(ch, muonHit->X(), muonHit->Y(), muonHit->Z());
gtrack->SetMomReconstr(particle->Px(), particle->Py(), particle->Pz());
kMaxRadius[6] = kMaxRadius[7] = 260.0;
kMaxRadius[8] = kMaxRadius[9] = 260.0;
- TH2F *xygen_found[10];
- TH2F *xygen_lost[10];
- TH2F *xyreco_good[10];
- TH2F *xyreco_fake[10];
+ TH2F *xygenFound[10];
+ TH2F *xygenLost[10];
+ TH2F *xyrecoGood[10];
+ TH2F *xyrecoFake[10];
Double_t x,y,r;
Int_t matches[500];
Int_t index, ch;
// Define histograms for x-y plots
for (ch=0; ch<10; ch++) {
- xygen_found[ch] = new TH2F("xygen_found","",50,-kMaxRadius[ch],kMaxRadius[ch],50,-kMaxRadius[ch],kMaxRadius[ch]);
- xygen_lost[ch] = new TH2F("xygen_lost","",50,-kMaxRadius[ch],kMaxRadius[ch],50,-kMaxRadius[ch],kMaxRadius[ch]);
- xyreco_good[ch] = new TH2F("xyreco_good","",50,-kMaxRadius[ch],kMaxRadius[ch],50,-kMaxRadius[ch],kMaxRadius[ch]);
- xyreco_fake[ch] = new TH2F("xyreco_fake","",50,-kMaxRadius[ch],kMaxRadius[ch],50,-kMaxRadius[ch],kMaxRadius[ch]);
+ xygenFound[ch] = new TH2F("xygen_found","",50,-kMaxRadius[ch],kMaxRadius[ch],50,-kMaxRadius[ch],kMaxRadius[ch]);
+ xygenLost[ch] = new TH2F("xygen_lost","",50,-kMaxRadius[ch],kMaxRadius[ch],50,-kMaxRadius[ch],kMaxRadius[ch]);
+ xyrecoGood[ch] = new TH2F("xyreco_good","",50,-kMaxRadius[ch],kMaxRadius[ch],50,-kMaxRadius[ch],kMaxRadius[ch]);
+ xyrecoFake[ch] = new TH2F("xyreco_fake","",50,-kMaxRadius[ch],kMaxRadius[ch],50,-kMaxRadius[ch],kMaxRadius[ch]);
}
// find list of matching tracks
fPrinted = kTRUE; // no need to print
r = TMath::Sqrt(x*x +y*y);
if (r >= 10) {
if (wasreconst) {
- xygen_found[ch]->Fill(x,y);
- } else {xygen_lost[ch]->Fill(x,y);}
+ xygenFound[ch]->Fill(x,y);
+ } else {xygenLost[ch]->Fill(x,y);}
}
}
}
r = TMath::Sqrt(x*x +y*y);
if (r >= 10) {
if (matches[index] >= 0) {
- xyreco_good[ch]->Fill(x,y);
- } else {xyreco_fake[ch]->Fill(x,y);}
+ xyrecoGood[ch]->Fill(x,y);
+ } else {xyrecoFake[ch]->Fill(x,y);}
}
}
}
// finally plot them
for (ch=0; ch<10; ch++) {
canvas->cd(ch+1);
- xygen_found[ch]->SetMarkerColor(kBlue);
- xygen_found[ch]->SetMarkerStyle(4);
- xygen_found[ch]->SetMarkerSize(0.5);
- xygen_found[ch]->SetStats(kFALSE);
- xygen_found[ch]->Draw();
- xygen_lost[ch]->SetMarkerColor(kCyan);
- xygen_lost[ch]->SetMarkerStyle(4);
- xygen_lost[ch]->SetMarkerSize(0.5);
- xygen_lost[ch]->SetStats(kFALSE);
- xygen_lost[ch]->Draw("SAME");
- xyreco_good[ch]->SetMarkerColor(kGreen);
- xyreco_good[ch]->SetMarkerStyle(20);
- xyreco_good[ch]->SetMarkerSize(0.4);
- xyreco_good[ch]->SetStats(kFALSE);
- xyreco_good[ch]->Draw("SAME");
- xyreco_fake[ch]->SetMarkerColor(kRed);
- xyreco_fake[ch]->SetMarkerStyle(20);
- xyreco_fake[ch]->SetMarkerSize(0.5);
- xyreco_fake[ch]->SetStats(kFALSE);
- xyreco_fake[ch]->Draw("SAME");
+ xygenFound[ch]->SetMarkerColor(kBlue);
+ xygenFound[ch]->SetMarkerStyle(4);
+ xygenFound[ch]->SetMarkerSize(0.5);
+ xygenFound[ch]->SetStats(kFALSE);
+ xygenFound[ch]->Draw();
+ xygenLost[ch]->SetMarkerColor(kCyan);
+ xygenLost[ch]->SetMarkerStyle(4);
+ xygenLost[ch]->SetMarkerSize(0.5);
+ xygenLost[ch]->SetStats(kFALSE);
+ xygenLost[ch]->Draw("SAME");
+ xyrecoGood[ch]->SetMarkerColor(kGreen);
+ xyrecoGood[ch]->SetMarkerStyle(20);
+ xyrecoGood[ch]->SetMarkerSize(0.4);
+ xyrecoGood[ch]->SetStats(kFALSE);
+ xyrecoGood[ch]->Draw("SAME");
+ xyrecoFake[ch]->SetMarkerColor(kRed);
+ xyrecoFake[ch]->SetMarkerStyle(20);
+ xyrecoFake[ch]->SetMarkerSize(0.5);
+ xyrecoFake[ch]->SetStats(kFALSE);
+ xyrecoFake[ch]->Draw("SAME");
}
canvas->SetTitle("y vs. x for simulated and reconstructed tracks");
pad->cd();
// loop events
for (Int_t event=first; event<=last; event++) {
// get the reco. & gen. events
- TFile *galice_file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
- galice_file->cd();
+ TFile *galiceFile = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
+ galiceFile->cd();
gAlice->GetEvent(event);
MapEvent(event);
if (fEmpty) {
void AliMUONRecoDisplay::ShowNextEvent(Int_t delta)
{
// overwritten from AliDisplay in order to get also mapping of next event
- TFile *galice_file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
- galice_file->cd();
+ TFile *galiceFile = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
+ galiceFile->cd();
if (delta) {
gAlice->Clear();
Int_t currentEvent = gAlice->GetHeader()->GetEvent();
// true if at least three hits in first 2 stations, 3 in last 2 stations
// and one in station 3
if (fEmpty) return kFALSE;
- AliDetector *MUON = gAlice->GetDetector("MUON");
+ AliDetector *pMUON = gAlice->GetDetector("MUON");
Bool_t chHit[10];
Int_t ch;
for (ch=0; ch<10; ch++) chHit[ch] = kFALSE;
//loop hits
- for (AliMUONHit *muonHit=(AliMUONHit*)MUON->FirstHit(track);
+ for (AliMUONHit *muonHit=(AliMUONHit*)pMUON->FirstHit(track);
muonHit;
- muonHit=(AliMUONHit*)MUON->NextHit()) {
- ch = muonHit->fChamber - 1;
+ muonHit=(AliMUONHit*)pMUON->NextHit()) {
+ ch = muonHit->Chamber() - 1;
if (ch<0 || ch>9) continue;
chHit[ch] = kTRUE;
}