void AliPHOSAnalyze::DisplayRecParticles()
{
if (fEvt == -999) {
- cout << "DisplayRecPoints > Analyze an event first ... (y/n) " ;
+ cout << "DisplayRecParticles > Analyze an event first ... (y/n) " ;
Text_t answer[1] ;
cin >> answer ; cout << answer ;
if ( answer == "y" )
if (fEvt != -999) {
Int_t module ;
- cout << "DisplayRecPoints > which module (1-5, -1: all) ? " ;
+ cout << "DisplayRecParticles > which module (1-5, -1: all) ? " ;
cin >> module ; cout << module << endl ;
Text_t histoname[80] ;
sprintf(histoname,"Event %d: Reconstructed particles in module %d", fEvt, module) ;
}
}
histoRparticle->Draw("color") ;
+
+ nextRecPart.Reset() ;
+ while ( (rp = (AliPHOSRecParticle *)nextRecPart() ) ) {
+ AliPHOSTrackSegment * ts = rp->GetPHOSTrackSegment() ;
+ if ( ts->GetPHOSMod() == module )
+ rp->Draw("P") ;
+ }
+
Text_t text[80] ;
sprintf(text, "reconstructed particles: %d", nRecParticlesInModule) ;
TPaveText * pavetext = new TPaveText(292, 100, 300, 101);
// --- AliRoot header files ---
#include "AliPHOSRecParticle.h"
+#include "TPad.h"
ClassImp(AliPHOSRecParticle)
}
+//____________________________________________________________________________
+Int_t AliPHOSRecParticle::DistancetoPrimitive(Int_t px, Int_t py)
+{
+ // Compute distance from point px,py to a AliPHOSRecParticle considered as a Tmarker
+ // Compute the closest distance of approach from point px,py to this marker.
+ // The distance is computed in pixels units.
+
+ Double_t kRADDEG = 180. / TMath::Pi() ;
+ Coord_t x = Phi() * kRADDEG ;
+ Coord_t y = Theta() * kRADDEG ;
+ const Int_t kMaxDiff = 10;
+ Int_t pxm = gPad->XtoAbsPixel(x);
+ Int_t pym = gPad->YtoAbsPixel(y);
+ Int_t dist = (px-pxm)*(px-pxm) + (py-pym)*(py-pym);
+
+ if (dist > kMaxDiff) return 9999;
+ return dist;
+}
+
+//___________________________________________________________________________
+ void AliPHOSRecParticle::Draw(Option_t *option)
+ {
+ // Draw this AliPHOSRecParticle with its current attributes
+
+ AppendPad(option);
+ }
+
+//______________________________________________________________________________
+void AliPHOSRecParticle::ExecuteEvent(Int_t event, Int_t px, Int_t py)
+{
+ // Execute action corresponding to one event
+ // This member function is called when a AliPHOSRecParticle is clicked with the locator
+ //
+
+ if (!gPad->IsEditable())
+ return ;
+
+ static TPaveText * clustertext = 0 ;
+
+ switch (event) {
+
+ case kButton1Down: {
+ Double_t kRADDEG = 180. / TMath::Pi() ;
+ Coord_t x = Phi() * kRADDEG ;
+ Coord_t y = Theta() * kRADDEG ;
+ clustertext = new TPaveText(x-1, y+1, x+5, y+3, "") ;
+ Text_t line1[40] ;
+ Text_t line2[40] ;
+ sprintf( line1, "PID: %s ", (const char*)Name() ) ;
+ sprintf( line2, "ENERGY: %f ", Energy() ) ;
+ clustertext ->AddText(line1) ;
+ clustertext ->AddText(line2) ;
+ clustertext ->Draw("");
+ gPad->Update() ;
+ break ;
+ }
+
+ case kButton1Up: {
+ delete clustertext ;
+ clustertext = 0 ;
+ gPad->Update() ;
+ break ;
+ }
+
+ }
+
+}
//____________________________________________________________________________
TString AliPHOSRecParticle::Name()
{
return name ;
}
+//______________________________________________________________________________
+void AliPHOSRecParticle::Paint(Option_t *)
+{
+// Paint this ALiRecParticle in theta,phi coordinate as a TMarker with its current attributes
+
+ Double_t kRADDEG = 180. / TMath::Pi() ;
+ Coord_t x = Phi() * kRADDEG ;
+ Coord_t y = Theta() * kRADDEG ;
+ Color_t markercolor = 1 ;
+ Size_t markersize = 1. ;
+ Style_t markerstyle = 5 ;
+
+ if (!gPad->IsBatch()) {
+ gVirtualX->SetMarkerColor(markercolor) ;
+ gVirtualX->SetMarkerSize (markersize) ;
+ gVirtualX->SetMarkerStyle(markerstyle) ;
+ }
+ gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ;
+ gPad->PaintPolyMarker(1,&x,&y,"") ;
+}
+
//____________________________________________________________________________
void AliPHOSRecParticle::Print()
{