* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id$ */
//////////////////////////////////////////////////////////////////////////
// //
#include <TRandom.h>
#include <X3DBuffer.h>
#include <TParticle.h>
-
+#include "AliRICHChamber.h"
#include "AliRun.h"
#include "AliPDG.h"
#include "AliDetector.h"
#include "AliRICH.h"
-#include "AliRICHConst.h"
#include "AliRICHDisplay.h"
#include "AliRICHPoints.h"
#include "AliHeader.h"
#include "AliRICHSDigit.h"
-#include "AliRICHDigit.h"
-#include "AliRICHRawCluster.h"
-#include "AliRICHRecHit1D.h"
-#include "AliRICHRecHit3D.h"
+#include "AliMC.h"
ClassImp(AliRICHDisplay)
//_____________________________________________________________________________
AliRICHDisplay::AliRICHDisplay(Int_t size)
{
-// Create an event display object.
-// A canvas named "edisplay" is created with a vertical size in pixels
-//
-// A QUICK Overview of the Event Display functions
-// ===============================================
-//
-// The event display can ve invoked by executing the macro "display.C"
-// A canvas like in the picture below will appear.
-//
-// On the left side of the canvas, the following buttons appear:
-// *Next* to move to the next event
-// *Previous* to move to the previous event
-
-// *Pick* Select this option to be able to point on a track with the
-// mouse. Once on the track, use the right button to select
-// an action. For example, select SetMarkerAttributes to
-// change the marker type/color/size for the track.
-// *Zoom* Select this option (default) if you want to zoom.
-// To zoom, simply select the selected area with the left button.
-// *UnZoom* To revert to the previous picture size.
-//
-// slider R On the left side, the vertical slider can be used to
-// set the default picture size.
-//
-// When you are in Zoom mode, you can click on the black part of the canvas
-// to select special options with the right mouse button.
-
-//
-// When you are in pick mode, you can "Inspect" the object pointed by the mouse.
-// When you are on a track, select the menu item "InspectParticle"
-// to display the current particle attributes.
-//
-// You can activate the Root browser by selecting the Inspect menu
-// in the canvas tool bar menu. Then select "Start Browser"
-// This will open a new canvas with the browser. At this point, you may want
-// to display some histograms (from the Trees). Go to the "File" menu
-// of the browser and click on "New canvas".
-// In the browser, click on item "ROOT files" in the left pane.
-// Click on galice.root.
-// Click on TH
-// Click on TPC for example
-// Click on any variable (eg TPC.fX) to histogram the variable.
-//
-// If you are lost, you can click on HELP in any Root canvas or browser.
-//Begin_Html
-/*
- <img src="gif/AliRICHDisplay.gif">
-*/
-//End_Html
-
fPad = 0;
sprintf(ptitle,"Alice event: %d, Run:%d",
gAlice->GetHeader()->GetEvent(), gAlice->GetHeader()->GetRun());
title->AddText(ptitle);
- Int_t nparticles = gAlice->Particles()->GetEntriesFast();
+ Int_t nparticles = gAlice->GetMCApp()->Particles()->GetEntriesFast();
sprintf(ptitle,"Nparticles = %d Nhits = %d Npads fired = %d",
nparticles, fHitsCuts,fClustersCuts);
title->AddText(ptitle);
// Read raw clusters info and store x,y,z info in arrays fRpoints
// Loop on all detectors
- if (chamber > 6) return;
-
- //printf("Entering LoadCoG\n");
-
+ if (chamber > 7) return;
AliRICH *pRICH = (AliRICH*)gAlice->GetModule("RICH");
AliRICHChamber* iChamber;
- TClonesArray *pRICHrawclust = pRICH->RawClustAddress(chamber);
- //printf ("Chamber:%d has adress:%p\n", chamber, pRICHrawclust );
+ TClonesArray *pRICHrawclust = pRICH->Clusters(chamber);
if (pRICHrawclust == 0) return;
- pRICH->ResetRawClusters();
+ pRICH->ResetClusters();
Int_t nent=(Int_t)gAlice->TreeR()->GetEntries();
if (fRpoints == 0) fRpoints = new TObjArray(nrawcl);
iChamber = &(pRICH->Chamber(chamber));
- AliRICHRawCluster *mRaw;
+ AliRICHcluster *mRaw;
AliRICHPoints *points = 0;
//
//loop over all raw clusters and store their position
points = new AliRICHPoints(nrawcl);
for (Int_t iraw=0;iraw<nrawcl;iraw++) {
- mRaw = (AliRICHRawCluster*)pRICHrawclust->UncheckedAt(iraw);
+ mRaw = (AliRICHcluster*)pRICHrawclust->UncheckedAt(iraw);
fRpoints->AddAt(points,iraw);
points->SetMarkerColor(3);
points->SetMarkerStyle(3);
points->SetHitIndex(-1);
points->SetTrackIndex(-1);
points->SetDigitIndex(-1);
- Float_t vectorLoc[3]={mRaw->fX,5,mRaw->fY};
+ Float_t vectorLoc[3]={mRaw->X(),5,mRaw->Y()};
Float_t vectorGlob[3];
iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
points->SetPoint(iraw,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
}
-}
+}//LoadCoG()
//___________________________________________
void AliRICHDisplay::LoadRecHits(Int_t chamber, Int_t cathode)
{
-// Read rec. hits info
-// Loop on all detectors
-
- if (chamber > 6) return;
-
- ///printf("Entering LoadRecHits\n");
-
-
- AliRICH *pRICH = (AliRICH*)gAlice->GetModule("RICH");
- AliRICHChamber* iChamber;
-
- TClonesArray *pRICHrechits1D = pRICH->RecHitsAddress1D(chamber);
- //printf ("Chamber:%d\n", chamber);
- if (pRICHrechits1D != 0)
- {
-
- //RICH->ResetRecHits();
-
-
- Int_t nent1D=(Int_t)gAlice->TreeR()->GetEntries();
- gAlice->TreeR()->GetEvent(nent1D-1+cathode-1);
- Int_t nrechits1D = pRICHrechits1D->GetEntriesFast();
- //printf ("nrechits1D:%d\n",nrechits1D);
- if (nrechits1D != 0)
- {
- if (fRecpoints == 0) fRecpoints = new TObjArray(50);
-
- iChamber = &(pRICH->Chamber(chamber));
- AliRICHRecHit1D *mRec1D;
- AliRICHPoints *points1D = 0;
- //loop over all rechits and store their position
-
- points1D = new AliRICHPoints(nrechits1D);
- for (Int_t irec=0;irec<nrechits1D;irec++) {
- mRec1D = (AliRICHRecHit1D*)pRICHrechits1D->UncheckedAt(irec);
- fRecpoints->AddAt(points1D,irec);
- points1D->SetMarkerColor(38);
- points1D->SetMarkerStyle(8);
- points1D->SetMarkerSize(.5);
- points1D->SetParticle(-1);
- points1D->SetHitIndex(-1);
- points1D->SetTrackIndex(-1);
- points1D->SetDigitIndex(-1);
- Float_t vectorLoc[3]={mRec1D->fX,5,mRec1D->fY};
- Float_t vectorGlob[3];
- iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
- points1D->SetPoint(irec,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
- }
- }
- }
-
- TClonesArray *pRICHrechits3D = pRICH->RecHitsAddress3D(chamber);
- //printf ("Chamber:%d\n", chamber);
- if (pRICHrechits3D != 0)
- {
-
- //RICH->ResetRecHits();
-
-
- Int_t nent3D=(Int_t)gAlice->TreeR()->GetEntries();
- gAlice->TreeR()->GetEvent(nent3D-1+cathode-1);
- Int_t nrechits3D = pRICHrechits3D->GetEntriesFast();
- //printf ("nrechits3D:%d\n",nrechits3D);
- if (nrechits3D != 0)
- {
- if (fRecpoints == 0) fRecpoints = new TObjArray(50);
-
- iChamber = &(pRICH->Chamber(chamber));
- AliRICHRecHit3D *mRec3D;
- AliRICHPoints *points3D = 0;
- //
- //loop over all rechits and store their position
-
- points3D = new AliRICHPoints(nrechits3D);
- for (Int_t irec=0;irec<nrechits3D;irec++) {
- mRec3D = (AliRICHRecHit3D*)pRICHrechits3D->UncheckedAt(irec);
- fRecpoints->AddAt(points3D,irec);
- points3D->SetMarkerColor(42);
- points3D->SetMarkerStyle(8);
- points3D->SetMarkerSize(1.);
- points3D->SetParticle(-1);
- points3D->SetHitIndex(-1);
- points3D->SetTrackIndex(-1);
- points3D->SetDigitIndex(-1);
- Float_t vectorLoc[3]={mRec3D->fX,5,mRec3D->fY};
- Float_t vectorGlob[3];
- iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
- points3D->SetPoint(irec,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
- //Float_t theta = iChamber->GetRotMatrix()->GetTheta();
- //Float_t phi = iChamber->GetRotMatrix()->GetPhi();
- //marker->SetRefObject((TObject*)points3D);
- //points3D->Set3DMarker(0, marker);
- }
- }
- }
+ chamber++;cathode++;
}
//___________________________________________
void AliRICHDisplay::LoadDigits()
if (gAlice->TreeD())
{
- for (ich=0; ich<kNCH; ich++) {
- TClonesArray *pRICHdigits = pRICH->DigitsAddress(ich);
- //printf ("Chamber:%d has adress:%p\n", ich, pRICHdigits );
+ for (ich=1; ich<=kNCH; ich++) {
+ TClonesArray *pRICHdigits = pRICH->Digits(ich);
if (pRICHdigits == 0) continue;
gAlice->ResetDigits();
gAlice->TreeD()->GetEvent(0);
Int_t ndigits = pRICHdigits->GetEntriesFast();
- //printf("ndigits:%d\n",ndigits);
nAllDigits+=ndigits;
}
if (fPoints == 0) fPoints = new TObjArray(nAllDigits);
Int_t counter=0;
- for (ich=0; ich<kNCH; ich++) {
- TClonesArray *pRICHdigits = pRICH->DigitsAddress(ich);
+ for (ich=1; ich<=kNCH; ich++) {
+ TClonesArray *pRICHdigits = pRICH->Digits(ich);
if (pRICHdigits == 0) continue;
gAlice->ResetDigits();
gAlice->TreeD()->GetEvent(0);
//printf("Dpx:%d, Dpy:%d\n",dpx,dpy);
- AliRICHDigit *mdig;
+ AliRICHdigit *mdig;
AliRICHPoints *points = 0;
TMarker3DBox *marker = 0;
//
Int_t npoints=1;
for (Int_t digit=0;digit<ndigits;digit++) {
- mdig = (AliRICHDigit*)pRICHdigits->UncheckedAt(digit);
+ mdig = (AliRICHdigit*)pRICHdigits->UncheckedAt(digit);
points = new AliRICHPoints(npoints);
fPoints->AddAt(points,counter);
counter++;
- Int_t charge=mdig->Signal();
+ Int_t charge=(Int_t)mdig->Q();
Int_t index=Int_t(TMath::Log(charge)/(TMath::Log(kadc_satm)/22));
Int_t color=701+index;
if (color>722) color=722;
points->SetMarkerStyle(21);
points->SetMarkerSize(0.5);
Float_t xpad, ypad, zpad;
- segmentation->GetPadC(mdig->PadX(), mdig->PadY(),xpad, ypad, zpad);
+ segmentation->GetPadC(mdig->X(), mdig->Y(),xpad, ypad, zpad);
Float_t vectorLoc[3]={xpad,5,ypad};
Float_t vectorGlob[3];
iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
points->SetPoint(0,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
//printf("Y position (digit): %f\n", vectorGlob[1]);
- segmentation->GetPadC(mdig->PadX(), mdig->PadY(), xpad, ypad, zpad);
+ segmentation->GetPadC(mdig->X(), mdig->Y(), xpad, ypad, zpad);
Float_t theta = iChamber->GetRotMatrix()->GetTheta();
Float_t phi = iChamber->GetRotMatrix()->GetPhi();
marker=new TMarker3DBox(vectorGlob[0],vectorGlob[1],vectorGlob[2],
} // loop over digits
} // loop over chambers
} //if TreeD
-}
-
-
-//___________________________________________
+}//LoadDigits();
+//__________________________________________________________________________________________________
void AliRICHDisplay::LoadHits(Int_t chamber)
{
// Read hits info and store x,y,z info in arrays fPhits
points = new AliRICHPoints(1);
fPhits->AddAt(points,npoints);
mHit = (AliRICHhit*)pRICHhits->UncheckedAt(hit);
- TParticle *current = (TParticle*)gAlice->Particle(mHit->Track());
+ TParticle *current = (TParticle*)gAlice->GetMCApp()->Particle(mHit->Track());
if (current->GetPdgCode() == 50000050) {
points->SetMarkerColor(kBlue);
} else if (current->GetPdgCode() == 50000051) {
npoints++;
}
}
-}
-
-//_____________________________________________________________________________
-
+}//LoadHits()
+//__________________________________________________________________________________________________
void AliRICHDisplay::LoadCerenkovs(Int_t chamber)
{
// Read cerenkov hits info and store x,y,z info in array fPCerenkovs