+++ /dev/null
-
-Unix.*.Root.MacroPath: .:$(ALICE_ROOT)/macros:$(ALICE_ROOT)
-
-Root.Html.OutputDir: $(ALICE_ROOT)/html/roothtml/PHOS
-Root.Html.SourceDir: ./
-Root.Html.Author: YS
-Root.Html.Root: http://root.cern.ch/root/html
#ifndef ALIPHOS_H
#define ALIPHOS_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
////////////////////////////////////////////////
// Abstract Base Class for PHOS //
--- /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. *
+ **************************************************************************/
+
+//_________________________________________________________________________
+// Algorythm class to analyze PHOS events
+//*-- Y. Schutz : SUBATECH
+//////////////////////////////////////////////////////////////////////////////
+
+// --- ROOT system ---
+
+#include "TH2.h"
+#include "TParticle.h"
+#include "TClonesArray.h"
+#include "TTree.h"
+#include "TMath.h"
+#include "TCanvas.h"
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+
+#include "AliRun.h"
+#include "AliPHOSAnalyze.h"
+#include "AliPHOSClusterizerv1.h"
+#include "AliPHOSTrackSegmentMakerv1.h"
+#include "AliPHOSParticleGuesserv1.h"
+#include "AliPHOSReconstructioner.h"
+#include "AliPHOSDigit.h"
+#include "AliPHOSTrackSegment.h"
+#include "AliPHOSRecParticle.h"
+
+ClassImp(AliPHOSAnalyze)
+
+
+//____________________________________________________________________________
+ AliPHOSAnalyze::AliPHOSAnalyze()
+{
+ // ctor
+
+ fRootFile = 0 ;
+}
+
+//____________________________________________________________________________
+AliPHOSAnalyze::AliPHOSAnalyze(Text_t * name)
+{
+ // ctor
+
+ Bool_t OK = OpenRootFile(name) ;
+ if ( !OK ) {
+ cout << " AliPHOSAnalyze > Error opening " << name << endl ;
+ }
+ else {
+ gAlice = (AliRun*) fRootFile->Get("gAlice");
+ fPHOS = (AliPHOSv0 *)gAlice->GetDetector("PHOS") ;
+ fGeom = AliPHOSGeometry::GetInstance( fPHOS->GetGeometry()->GetName(), fPHOS->GetGeometry()->GetTitle() ) ;
+ fEvt = -999 ;
+ }
+}
+
+//____________________________________________________________________________
+AliPHOSAnalyze::~AliPHOSAnalyze()
+{
+ // dtor
+
+ fRootFile->Close() ;
+ delete fRootFile ;
+ fRootFile = 0 ;
+
+ delete fPHOS ;
+ fPHOS = 0 ;
+
+ delete fClu ;
+ fClu = 0 ;
+
+ delete fPag ;
+ fPag = 0 ;
+
+ delete fRec ;
+ fRec = 0 ;
+
+ delete fTrs ;
+ fTrs = 0 ;
+
+}
+
+//____________________________________________________________________________
+void AliPHOSAnalyze::AnalyzeOneEvent(Int_t evt)
+{
+ Bool_t OK = Init(evt) ;
+
+ if ( OK ) {
+ //=========== Get the number of entries in the Digits array
+
+ Int_t nId = fPHOS->Digits()->GetEntries();
+ printf("AnalyzeOneEvent > Number of entries in the Digit array is %d \n",nId);
+
+ //=========== Do the reconstruction
+
+ cout << "AnalyzeOneEvent > Found " << nId << " digits in PHOS" << endl ;
+
+ fPHOS->Reconstruction(fRec);
+
+ // =========== End of reconstruction
+
+ cout << "AnalyzeOneEvent > event # " << fEvt << " processed" << endl ;
+ } // OK
+ else
+ cout << "AnalyzeOneEvent > filed to process event # " << evt << endl ;
+
+}
+
+//____________________________________________________________________________
+Bool_t AliPHOSAnalyze::Init(Int_t evt)
+{
+
+ Bool_t OK = kTRUE ;
+
+ //========== Open galice root file
+
+ if ( fRootFile == 0 ) {
+ Text_t * name = new Text_t[80] ;
+ cout << "AnalyzeOneEvent > Enter file root file name : " ;
+ cin >> name ;
+ Bool_t OK = OpenRootFile(name) ;
+ if ( !OK )
+ cout << " AliPHOSAnalyze > Error opening " << name << endl ;
+ else {
+ //========== Get AliRun object from file
+
+ gAlice = (AliRun*) fRootFile->Get("gAlice") ;
+
+ //=========== Get the PHOS object and associated geometry from the file
+
+ fPHOS = (AliPHOSv0 *)gAlice->GetDetector("PHOS") ;
+ fGeom = AliPHOSGeometry::GetInstance( fPHOS->GetGeometry()->GetName(), fPHOS->GetGeometry()->GetTitle() );
+ } // else !OK
+ } // if fRootFile
+
+ if ( OK ) {
+
+ //========== Create the Clusterizer
+
+ fClu = new AliPHOSClusterizerv1() ;
+ fClu->SetEmcEnergyThreshold(0.01) ;
+ fClu->SetEmcClusteringThreshold(0.1) ;
+ fClu->SetPpsdEnergyThreshold(0.0000001) ;
+ fClu->SetPpsdClusteringThreshold(0.0000002) ;
+ fClu->SetLocalMaxCut(0.03) ;
+ fClu->SetCalibrationParameters(0., 0.0000001) ;
+ cout << "AnalyzeOneEvent > using clusterizer " << fClu->GetName() << endl ;
+ fClu->PrintParameters() ;
+
+ //========== Creates the track segment maker
+
+ fTrs = new AliPHOSTrackSegmentMakerv1() ;
+ cout << "AnalyzeOneEvent > using tack segment maker " << fTrs->GetName() << endl ;
+
+ //========== Creates the particle guesser
+
+ fPag = new AliPHOSParticleGuesserv1() ;
+ cout << "AnalyzeOneEvent > using particle guess " << fPag->GetName() << endl ;
+
+ //========== Creates the Reconstructioner
+
+ fRec = new AliPHOSReconstructioner(fClu, fTrs, fPag) ;
+
+ //=========== Connect the various Tree's for evt
+
+ if ( evt == -999 ) {
+ cout << "AnalyzeOneEvent > Enter event number : " ;
+ cin >> evt ;
+ cout << evt << endl ;
+ }
+ fEvt = evt ;
+ gAlice->GetEvent(evt);
+
+ //=========== Get the Digit TTree
+
+ gAlice->TreeD()->GetEvent(0) ;
+
+ } // OK
+
+ return OK ;
+}
+
+//____________________________________________________________________________
+void AliPHOSAnalyze:: DisplayKineEvent(Int_t evt)
+{
+ if (evt == -999)
+ evt = fEvt ;
+
+ Int_t Module ;
+ cout << "DisplayKineEvent > which module (1-5, -1: all) ? " ;
+ cin >> Module ; cout << Module << endl ;
+
+ Int_t TestParticle ;
+ cout << " 22 : PHOTON " << endl
+ << " (-)11 : (POSITRON)ELECTRON " << endl
+ << " (-)2112 : (ANTI)NEUTRON " << endl
+ << " -999 : Everything else " << endl ;
+ cout << "DisplayKineEvent > enter PDG particle code to display " ;
+ cin >> TestParticle ; cout << TestParticle << endl ;
+
+ Text_t HistoName[80] ;
+ sprintf(HistoName,"Event %d: Incident particles in module %d", evt, Module) ;
+
+ Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by Module
+ fGeom->EmcModuleCoverage(Module, tm, tM, pm, pM, kDegre) ;
+
+ Double_t theta, phi ;
+ fGeom->EmcXtalCoverage(theta, phi, kDegre) ;
+
+ Int_t tdim = (Int_t)( (tM - tm) / theta ) ;
+ Int_t pdim = (Int_t)( (pM - pm) / phi ) ;
+
+ tm -= theta ;
+ tM += theta ;
+ pm -= phi ;
+ pM += phi ;
+
+ TH2F * HistoParticle = new TH2F("HistoParticle", HistoName,
+ pdim, pm, pM, tdim, tm, tM) ;
+ HistoParticle->SetStats(kFALSE) ;
+
+ // Get pointers to Alice Particle TClonesArray
+
+ TParticle * Particle;
+ TClonesArray * ArrayOfParticles = gAlice->Particles();
+
+ Text_t CanvasName[80];
+ sprintf(CanvasName,"Particles incident in PHOS/EMC module # %d",Module) ;
+ TCanvas * KineCanvas = new TCanvas("KineCanvas", CanvasName, 650, 500) ;
+
+ // get the KINE Tree
+
+ TTree * Kine = gAlice->TreeK() ;
+ Stat_t NumberOfParticles = Kine->GetEntries() ;
+ cout << "DisplayKineEvent > events in Kine " << NumberOfParticles << endl ;
+
+ // loop over particles
+
+ Double_t raddeg = 180. / TMath::Pi() ;
+ Int_t index1 ;
+ Int_t nparticlein = 0 ;
+ for (index1 = 0 ; index1 < NumberOfParticles ; index1++){
+ Int_t nparticle = ArrayOfParticles->GetEntriesFast() ;
+ Int_t index2 ;
+ for( index2 = 0 ; index2 < nparticle ; index2++) {
+ Particle = (TParticle*)ArrayOfParticles->UncheckedAt(index2) ;
+ Int_t ParticleType = Particle->GetPdgCode() ;
+ if (TestParticle == -999 || TestParticle == ParticleType) {
+ Double_t Phi = Particle->Phi() ;
+ Double_t Theta = Particle->Theta() ;
+ Int_t mod ;
+ Double_t x, z ;
+ fGeom->ImpactOnEmc(Theta, Phi, mod, z, x) ;
+ if ( mod == Module ) {
+ nparticlein++ ;
+ HistoParticle->Fill(Phi*raddeg, Theta*raddeg, Particle->Energy() ) ;
+ }
+ }
+ }
+ }
+ KineCanvas->Draw() ;
+ HistoParticle->Draw("color") ;
+ TPaveText * PaveText = new TPaveText(294, 100, 300, 101);
+ Text_t text[40] ;
+ sprintf(text, "Particles: %d ", nparticlein) ;
+ PaveText->AddText(text) ;
+ PaveText->Draw() ;
+ KineCanvas->Update();
+
+}
+//____________________________________________________________________________
+void AliPHOSAnalyze::DisplayRecParticles()
+{
+ if (fEvt == -999) {
+ cout << "DisplayRecPoints > Analyze an event first ... (y/n) " ;
+ Text_t answer[1] ;
+ cin >> answer ; cout << answer ;
+ if ( answer == "y" )
+ AnalyzeOneEvent() ;
+ }
+ if (fEvt != -999) {
+
+ Int_t Module ;
+ cout << "DisplayRecPoints > 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) ;
+ Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by Module
+ fGeom->EmcModuleCoverage(Module, tm, tM, pm, pM, kDegre) ;
+ Double_t theta, phi ;
+ fGeom->EmcXtalCoverage(theta, phi, kDegre) ;
+ Int_t tdim = (Int_t)( (tM - tm) / theta ) ;
+ Int_t pdim = (Int_t)( (pM - pm) / phi ) ;
+ tm -= theta ;
+ tM += theta ;
+ pm -= phi ;
+ TH2F * HistoRParticle = new TH2F("HistoRParticle", HistoName,
+ pdim, pm, pM, tdim, tm, tM) ;
+ HistoRParticle->SetStats(kFALSE) ;
+ Text_t CanvasName[80] ;
+ sprintf(CanvasName, "Reconstructed particles in PHOSmodule # %d", Module) ;
+ TCanvas * RParticleCanvas = new TCanvas("RparticleCanvas", CanvasName, 650, 500) ;
+ RecParticlesList * rpl = fPHOS->RecParticles() ;
+ Int_t NRecParticles = rpl->GetEntries() ;
+ Int_t NRecParticlesInModule = 0 ;
+ TIter nextRecPart(rpl) ;
+ AliPHOSRecParticle * rp ;
+ cout << "DisplayRecParticles > " << NRecParticles << " reconstructed particles " << endl ;
+ Double_t raddeg = 180. / TMath::Pi() ;
+ while ( (rp = (AliPHOSRecParticle *)nextRecPart() ) ) {
+ AliPHOSTrackSegment * ts = rp->GetPHOSTrackSegment() ;
+ if ( ts->GetPHOSMod() == Module ) {
+ NRecParticlesInModule++ ;
+ Double_t theta = rp->Theta() * raddeg ;
+ Double_t phi = rp->Phi() * raddeg ;
+ Double_t energy = rp->Energy() ;
+ HistoRParticle->Fill(phi, theta, energy) ;
+ }
+ }
+ HistoRParticle->Draw("color") ;
+ Text_t text[80] ;
+ sprintf(text, "reconstructed particles: %d", NRecParticlesInModule) ;
+ TPaveText * PaveText = new TPaveText(292, 100, 300, 101);
+ PaveText->AddText(text) ;
+ PaveText->Draw() ;
+ RParticleCanvas->Update() ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSAnalyze::DisplayRecPoints()
+{
+ if (fEvt == -999) {
+ cout << "DisplayRecPoints > Analyze an event first ... (y/n) " ;
+ Text_t answer[1] ;
+ cin >> answer ; cout << answer ;
+ if ( answer == "y" )
+ AnalyzeOneEvent() ;
+ }
+ if (fEvt != -999) {
+
+ Int_t Module ;
+ cout << "DisplayRecPoints > which module (1-5, -1: all) ? " ;
+ cin >> Module ; cout << Module << endl ;
+
+ Text_t CanvasName[80];
+ sprintf(CanvasName,"Digits in PHOS/EMC module # %d",Module) ;
+ TCanvas * ModuleCanvas = new TCanvas("Module", CanvasName, 650, 500) ;
+ ModuleCanvas->Draw() ;
+
+ //=========== Creating 2d-histogram of the PHOS Module
+ // a little bit junkie but is used to test Geom functinalities
+
+ Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by Module
+
+ fGeom->EmcModuleCoverage(Module, tm, tM, pm, pM);
+ // convert angles into coordinates local to the EMC module of interest
+
+ Int_t EmcModuleNumber ;
+ Double_t EmcModulexm, EmcModulezm ; // minimum local coordinate in a given EMCA module
+ Double_t EmcModulexM, EmcModulezM ; // maximum local coordinate in a given EMCA module
+ fGeom->ImpactOnEmc(tm, pm, EmcModuleNumber, EmcModulezm, EmcModulexm) ;
+ fGeom->ImpactOnEmc(tM, pM, EmcModuleNumber, EmcModulezM, EmcModulexM) ;
+ Int_t xdim = (Int_t)( ( EmcModulexM - EmcModulexm ) / fGeom->GetCrystalSize(0) ) ;
+ Int_t zdim = (Int_t)( ( EmcModulezM - EmcModulezm ) / fGeom->GetCrystalSize(2) ) ;
+ Float_t xmin = EmcModulexm - fGeom->GetCrystalSize(0) ;
+ Float_t xMax = EmcModulexM + fGeom->GetCrystalSize(0) ;
+ Float_t zmin = EmcModulezm - fGeom->GetCrystalSize(2) ;
+ Float_t zMax = EmcModulezM + fGeom->GetCrystalSize(2) ;
+ Text_t HistoName[80];
+ sprintf(HistoName,"Event %d: Digits and RecPoints in module %d", fEvt, Module) ;
+ TH2F * hModule = new TH2F("HistoReconstructed", HistoName,
+ xdim, xmin, xMax, zdim, zmin, zMax) ;
+ hModule->SetMaximum(2.0);
+ hModule->SetMinimum(0.0);
+ hModule->SetStats(kFALSE);
+
+ TIter next(fPHOS->Digits()) ;
+ Float_t Energy, y, z;
+ Int_t RelId[4]; Int_t NumberOfDigits = 0 ;
+ AliPHOSDigit * digit ;
+ Float_t Etot ;
+ while((digit = (AliPHOSDigit *)next()))
+ {
+ fGeom->AbsToRelNumbering(digit->GetId(), RelId) ;
+ if (RelId[0] == Module)
+ {
+ NumberOfDigits++ ;
+ Energy = fClu->Calibrate(digit->GetAmp()) ;
+ Etot += Energy ;
+ fGeom->RelPosInModule(RelId,y,z) ;
+ if (Energy > 0.01 )
+ hModule->Fill(y, z, Energy) ;
+ }
+ }
+ cout <<"DrawRecPoints > Found in Module "
+ << Module << " " << NumberOfDigits << " digits with total energy " << Etot << endl ;
+ hModule->Draw("col2") ;
+
+ //=========== Cluster in Module
+
+ TClonesArray * EmcRP = fPHOS->EmcClusters() ;
+ Etot = 0.;
+ Int_t TotalNumberOfClusters = 0 ;
+ Int_t NumberOfClusters = 0 ;
+ TIter nextemc(EmcRP) ;
+ AliPHOSEmcRecPoint * emc ;
+ while((emc = (AliPHOSEmcRecPoint *)nextemc()))
+ {
+ TotalNumberOfClusters++ ;
+ if ( emc->GetPHOSMod() == Module )
+ {
+ NumberOfClusters++ ;
+ Energy = emc->GetTotalEnergy() ;
+ Etot+= Energy ;
+ emc->Draw("P") ;
+ }
+ }
+ cout << "DrawRecPoints > Found " << TotalNumberOfClusters << " EMC Clusters in PHOS" << endl ;
+ cout << "DrawRecPoints > Found in Module " << Module << " " << NumberOfClusters << " EMC Clusters " << endl ;
+ cout << "DrawRecPoints > Total energy " << Etot << endl ;
+
+ TPaveText * PaveText = new TPaveText(22, 80, 83, 90);
+ Text_t text[40] ;
+ sprintf(text, "digits: %d; clusters: %d", NumberOfDigits, NumberOfClusters) ;
+ PaveText->AddText(text) ;
+ PaveText->Draw() ;
+ ModuleCanvas->Update();
+
+ //=========== Cluster in Module PPSD Down
+
+ TClonesArray * PpsdRP = fPHOS->PpsdClusters() ;
+ Etot = 0.;
+ TIter nextPpsd(PpsdRP) ;
+ AliPHOSPpsdRecPoint * Ppsd ;
+ while((Ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
+ {
+ TotalNumberOfClusters++ ;
+ if ( Ppsd->GetPHOSMod() == Module )
+ {
+ NumberOfClusters++ ;
+ Energy = Ppsd->GetEnergy() ;
+ Etot+=Energy ;
+ if (!Ppsd->GetUp()) Ppsd->Draw("P") ;
+ }
+ }
+ cout << "DrawRecPoints > Found " << TotalNumberOfClusters << " Ppsd Down Clusters in PHOS" << endl ;
+ cout << "DrawRecPoints > Found in Module " << Module << " " << NumberOfClusters << " Ppsd Down Clusters " << endl ;
+ cout << "DrawRecPoints > Total energy " << Etot << endl ;
+
+ //=========== Cluster in Module PPSD Up
+
+ PpsdRP = fPHOS->PpsdClusters() ;
+ Etot = 0.;
+ TIter nextPpsdUp(PpsdRP) ;
+ while((Ppsd = (AliPHOSPpsdRecPoint *)nextPpsdUp()))
+ {
+ TotalNumberOfClusters++ ;
+ if ( Ppsd->GetPHOSMod() == Module )
+ {
+ NumberOfClusters++ ;
+ Energy = Ppsd->GetEnergy() ;
+ Etot+=Energy ;
+ if (Ppsd->GetUp()) Ppsd->Draw("P") ;
+ }
+ }
+ cout << "DrawRecPoints > Found " << TotalNumberOfClusters << " Ppsd Up Clusters in PHOS" << endl ;
+ cout << "DrawRecPoints > Found in Module " << Module << " " << NumberOfClusters << " Ppsd Up Clusters " << endl ;
+ cout << "DrawRecPoints > Total energy " << Etot << endl ;
+
+ } // if !-999
+}
+
+//____________________________________________________________________________
+void AliPHOSAnalyze::DisplayTrackSegments()
+{
+ if (fEvt == -999) {
+ cout << "DisplayTrackSegments > Analyze an event first ... (y/n) " ;
+ Text_t answer[1] ;
+ cin >> answer ; cout << answer ;
+ if ( answer == "y" )
+ AnalyzeOneEvent() ;
+ }
+ if (fEvt != -999) {
+
+ Int_t Module ;
+ cout << "DisplayTrackSegments > which module (1-5, -1: all) ? " ;
+ cin >> Module ; cout << Module << endl ;
+ //=========== Creating 2d-histogram of the PHOS Module
+ // a little bit junkie but is used to test Geom functinalities
+
+ Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by Module
+
+ fGeom->EmcModuleCoverage(Module, tm, tM, pm, pM);
+ // convert angles into coordinates local to the EMC module of interest
+
+ Int_t EmcModuleNumber ;
+ Double_t EmcModulexm, EmcModulezm ; // minimum local coordinate in a given EMCA module
+ Double_t EmcModulexM, EmcModulezM ; // maximum local coordinate in a given EMCA module
+ fGeom->ImpactOnEmc(tm, pm, EmcModuleNumber, EmcModulezm, EmcModulexm) ;
+ fGeom->ImpactOnEmc(tM, pM, EmcModuleNumber, EmcModulezM, EmcModulexM) ;
+ Int_t xdim = (Int_t)( ( EmcModulexM - EmcModulexm ) / fGeom->GetCrystalSize(0) ) ;
+ Int_t zdim = (Int_t)( ( EmcModulezM - EmcModulezm ) / fGeom->GetCrystalSize(2) ) ;
+ Float_t xmin = EmcModulexm - fGeom->GetCrystalSize(0) ;
+ Float_t xMax = EmcModulexM + fGeom->GetCrystalSize(0) ;
+ Float_t zmin = EmcModulezm - fGeom->GetCrystalSize(2) ;
+ Float_t zMax = EmcModulezM + fGeom->GetCrystalSize(2) ;
+ Text_t HistoName[80];
+ sprintf(HistoName,"Event %d: Track Segments in module %d", fEvt, Module) ;
+ TH2F * HistoTrack = new TH2F("HistoTrack", HistoName,
+ xdim, xmin, xMax, zdim, zmin, zMax) ;
+ HistoTrack->SetStats(kFALSE);
+ Text_t CanvasName[80];
+ sprintf(CanvasName,"Track segments in PHOS/EMC-PPSD module # %d", Module) ;
+ TCanvas * TrackCanvas = new TCanvas("TrackSegmentCanvas", CanvasName, 650, 500) ;
+ HistoTrack->Draw() ;
+
+ TrackSegmentsList * trsegl = fPHOS->TrackSegments() ;
+ AliPHOSTrackSegment * trseg ;
+
+ Int_t NTrackSegments = trsegl->GetEntries() ;
+ Int_t index ;
+ Float_t Etot = 0 ;
+ Int_t NTrackSegmentsInModule = 0 ;
+ for(index = 0; index < NTrackSegments ; index++){
+ trseg = (AliPHOSTrackSegment * )trsegl->At(index) ;
+ Etot+= trseg->GetEnergy() ;
+ if ( trseg->GetPHOSMod() == Module ) {
+ NTrackSegmentsInModule++ ;
+ trseg->Draw("P");
+ }
+ }
+ Text_t text[80] ;
+ sprintf(text, "track segments: %d", NTrackSegmentsInModule) ;
+ TPaveText * PaveText = new TPaveText(22, 80, 83, 90);
+ PaveText->AddText(text) ;
+ PaveText->Draw() ;
+ TrackCanvas->Update() ;
+ cout << "DisplayTrackSegments > Found " << trsegl->GetEntries() << " Track segments with total energy "<< Etot << endl ;
+
+ }
+}
+//____________________________________________________________________________
+Bool_t AliPHOSAnalyze::OpenRootFile(Text_t * name)
+{
+ fRootFile = new TFile(name) ;
+ return fRootFile->IsOpen() ;
+}
--- /dev/null
+#ifndef ALIPHOSANALYZE_H
+#define ALIPHOSANALYZE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+////////////////////////////////////////////////
+// Algorythm class to analyze PHOS events //
+// Yves Schutz SUBATECH //
+// //
+// //
+////////////////////////////////////////////////
+
+// --- ROOT system ---
+
+#include "TFile.h"
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+
+#include "AliPHOSv0.h"
+#include "AliPHOSGeometry.h"
+
+class AliPHOSAnalyze : public TObject {
+
+public:
+
+ AliPHOSAnalyze() ; // ctor
+ AliPHOSAnalyze(Text_t * name) ; // ctor
+ virtual ~AliPHOSAnalyze() ; // dtor
+
+ void AnalyzeOneEvent(Int_t evt = -999) ; // analyzes a single event ;
+ Bool_t Init(Int_t evt) ; // does various initialisations
+ void DisplayKineEvent(Int_t evt = -999) ; // displays the Kine events in ALICE coordinate
+ void DisplayRecParticles() ; // displays RecParticles in ALICE coordinate
+ void DisplayRecPoints() ; // displays RecPoints in module coordinate
+ void DisplayTrackSegments() ; // displays TrackSegments in module coordinate
+ Bool_t OpenRootFile(Text_t * name) ; // opens the root file
+
+private:
+
+ AliPHOSClusterizer * fClu ; // a clusterizer
+ Int_t fEvt ; // the evt number being processed
+ AliPHOSGeometry * fGeom; // the PHOS Geometry object
+ AliPHOSv0 * fPHOS ; // the PHOS object from the root file
+ AliPHOSParticleGuesser * fPag ; // a particle guesser
+ AliPHOSReconstructioner * fRec ; // a reconstructioner
+ TFile * fRootFile ; // the root file that contains the data
+ AliPHOSTrackSegmentMaker * fTrs ; // a tracksegmentmaker ;
+public:
+
+ClassDef(AliPHOSAnalyze,1) // PHOS event analyzis , version 1
+
+};
+
+#endif // AliPHOSANALYZE_H
#define ALIPHOSCLUSTERIZER_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+
+/* $Id$ */
////////////////////////////////////////////////
// Algorithme class for the clusterization //
virtual Float_t Calibrate(Int_t Amp) = 0 ;
virtual void GetNumberOfClustersFound(Int_t * numb) = 0 ;
virtual void MakeClusters(const DigitsList * dl, RecPointsList * emccl, RecPointsList * ppsdl) = 0 ;
-
+ virtual void PrintParameters() = 0 ;
+ virtual void SetCalibrationParameters(Float_t A, Float_t B) = 0 ;
+ virtual void SetEmcClusteringThreshold(Float_t cluth) = 0 ;
+ virtual void SetEmcEnergyThreshold(Float_t enth) = 0 ;
+ virtual void SetLocalMaxCut(Float_t cut) = 0 ;
+ virtual void SetLogWeightCut(Float_t w) = 0 ;
+ virtual void SetPpsdClusteringThreshold(Float_t cluth) = 0 ;
+ virtual void SetPpsdEnergyThreshold(Float_t enth) = 0 ;
+
ClassDef(AliPHOSClusterizer,1) // clusterization interface, version 1
} ;
TIter nextdigit(&TempoDigitsList) ;
AliPHOSDigit * digit ;
Bool_t NotRemoved = kTRUE ;
- cout << "Cluster1" << endl;
+
while ( (digit = (AliPHOSDigit *)nextdigit()) ) { // scan over the list of digits
AliPHOSRecPoint * clu ;
Int_t iDigitInCluster = 0 ;
- if ( IsInEmc(digit) ) {
- emcl->Print("");
- cout << "Cluster2 EMC" << endl;
+ if ( IsInEmc(digit) ) {
new ((*emcl)[fNumberOfEmcClusters]) AliPHOSEmcRecPoint(fW0, fLocMaxCut) ; // start a new EMC RecPoint
clu = (AliPHOSEmcRecPoint *) (*emcl)[fNumberOfEmcClusters] ;
fNumberOfEmcClusters++ ;
}
else {
- cout << "Cluster2 PPSD" << endl;
new ((*ppsdl)[fNumberOfPpsdClusters]) AliPHOSPpsdRecPoint() ; // start a new PPSD cluster
clu = (AliPHOSPpsdRecPoint *) ppsdl->At(fNumberOfPpsdClusters) ;
fNumberOfPpsdClusters++ ;
- clu->AddDigit(*digit, 0.) ;
+ clu->AddDigit(*digit, Calibrate(digit->GetAmp()) ) ;
ClusterDigitsList[iDigitInCluster] = (int* ) digit ;
iDigitInCluster++ ;
TempoDigitsList.Remove(digit) ;
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/* $Id$ */
+
////////////////////////////////////////////////
// Clusterizer implementation version 1 //
// algorithme class //
virtual void GetNumberOfClustersFound(Int_t * numb) ;
Bool_t IsInEmc(AliPHOSDigit * digit) ; // Tells if id digit is in EMC
virtual void MakeClusters(const DigitsList * dl, RecPointsList * emcl, RecPointsList * ppsdl) ; // does the job
- void PrintParameters() ;
- void SetCalibrationParameters(Float_t A,Float_t B){ fA = A ; fB = B;}
- void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
- void SetEmcEnergyThreshold(Float_t enth) { fEmcEnergyThreshold = enth ; }
- void SetLocalMaxCut(Float_t cut) { fLocMaxCut = cut ; }
- void SetLogWeightCut(Float_t w) { fW0 = w ; }
- void SetPpsdClusteringThreshold(Float_t cluth) { fPpsdClusteringThreshold = cluth ; }
- void SetPpsdEnergyThreshold(Float_t enth) { fPpsdEnergyThreshold = enth ; }
+ virtual void PrintParameters() ;
+ virtual void SetCalibrationParameters(Float_t A,Float_t B){ fA = A ; fB = B;}
+ virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
+ virtual void SetEmcEnergyThreshold(Float_t enth) { fEmcEnergyThreshold = enth ; }
+ virtual void SetLocalMaxCut(Float_t cut) { fLocMaxCut = cut ; }
+ virtual void SetLogWeightCut(Float_t w) { fW0 = w ; }
+ virtual void SetPpsdClusteringThreshold(Float_t cluth) { fPpsdClusteringThreshold = cluth ; }
+ virtual void SetPpsdEnergyThreshold(Float_t enth) { fPpsdEnergyThreshold = enth ; }
private:
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/* $Id$ */
+
////////////////////////////////////////////////
// The digit class: a list of abs Id, energy//
// Version SUBATECH //
//______________________________________________________________________________
void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py)
{
-//*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*
-//*-* =========================================
-// This member function is called when a AliPHOSRecPoint is clicked with the locator
-//
-// If Left button is clicked on AliPHOSRecPoint, the digits are switched on
-// and switched off when the mouse button is released.
-//
+ //Execute action corresponding to one event
+ // This member function is called when a AliPHOSRecPoint is clicked with the locator
+ //
+ // If Left button is clicked on AliPHOSRecPoint, the digits are switched on
+ // and switched off when the mouse button is released.
+ //
// static Int_t pxold, pyold;
}
//____________________________________________________________________________
-Int_t AliPHOSEmcRecPoint::GetNumberOfLocalMax(int * maxAt, Float_t * maxAtEnergy)
+Int_t AliPHOSEmcRecPoint::GetNumberOfLocalMax(Int_t * maxAt, Float_t * maxAtEnergy)
{
AliPHOSDigit * digit ;
AliPHOSDigit * digitN ;
Int_t iDigitN ;
Int_t iDigit ;
- for(iDigit=0; iDigit<fMulDigit; iDigit++){
+ for(iDigit = 0; iDigit < fMulDigit; iDigit++){
maxAt[iDigit] = fDigitsList[iDigit] ;
}
- for(iDigit=0 ; iDigit<fMulDigit; iDigit++) {
+ for(iDigit = 0 ; iDigit < fMulDigit; iDigit++) {
if(maxAt[iDigit] != -1) {
digit = (AliPHOSDigit *) maxAt[iDigit] ;
- for(iDigitN=0; iDigitN<fMulDigit; iDigitN++) {
+ for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {
digitN = (AliPHOSDigit *) fDigitsList[iDigitN] ;
if ( AreNeighbours(digit, digitN) ) {
if (fEnergyList[iDigit] > fEnergyList[iDigitN] ) {
maxAt[iDigitN] = -1 ;
- //but may be digit is not local max too ?
- if(fEnergyList[iDigit]<fEnergyList[iDigitN]+fLocMaxCut)
+ // but may be digit too is not local max ?
+ if(fEnergyList[iDigit] < fEnergyList[iDigitN] + fLocMaxCut)
maxAt[iDigit] = -1 ;
}
else {
maxAt[iDigit] = -1 ;
- //but may be digitN is not local max too ?
- if(fEnergyList[iDigit] >fEnergyList[iDigitN]-fLocMaxCut)
+ // but may be digitN too is not local max ?
+ if(fEnergyList[iDigit] > fEnergyList[iDigitN] - fLocMaxCut)
maxAt[iDigitN] = -1 ;
}
} // if Areneighbours
} // while digit
iDigitN = 0 ;
- for(iDigit=0; iDigit<fMulDigit; iDigit++) {
+ for(iDigit = 0; iDigit < fMulDigit; iDigit++) {
if(maxAt[iDigit] != -1){
maxAt[iDigitN] = maxAt[iDigit] ;
maxAtEnergy[iDigitN] = fEnergyList[iDigit] ;
//____________________________________________________________________________
void AliPHOSEmcRecPoint::GetLocalPosition(TVector3 &LPos)
{
- if( fLocPos.X() < 1000000.) { //allready evaluated
+ if( fLocPos.X() < 1000000.) { // already evaluated
LPos = fLocPos ;
return ;
}
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/* $Id$ */
+
//////////////////////////////////////////////////
// Rec Point in the EM calorimeter of PHOS //
// //
Int_t GetMaximumMultiplicity() { return fMaxDigit ; }
Int_t GetMultiplicity(void) const { return fMulDigit ; }
Int_t GetMultiplicityAtLevel(const Float_t level) ; // computes multiplicity of digits with energy above relative level
- Int_t GetNumberOfLocalMax(int * maxAt, Float_t * maxAtEnergy) ; // searches for the local maxima
+ Int_t GetNumberOfLocalMax(Int_t * maxAt, Float_t * maxAtEnergy) ; // searches for the local maxima
Float_t GetTotalEnergy(void) const { return fAmp ; } // in EMC RecPoint Amp = Energy
void GetLocalPosition(TVector3 &Lpos) ; // computes the position in the PHOS module
Bool_t AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) ;
-public:
-
- // AliPHOSEmcRecPoint& operator = (AliPHOSEmcRecPoint clu) ;
-
-private:
-
Float_t fDelta ; // parameter used to sort the clusters
Float_t fLocMaxCut ; // parameter used for local maximum searc
Float_t * fEnergyList ; // energy of digits
public:
-ClassDef(AliPHOSEmcRecPoint,1) // EMC cluster, version 1
+ClassDef(AliPHOSEmcRecPoint,1) // EMC RecPoint, version 1
};
TRotation dummy = Rot.Invert() ; // to transform from original frame to rotate frame
gpos.Transform(Rot) ; // rotate the baby
+
}
//____________________________________________________________________________
if ( RelId[1] == 0 ) { // its a PbW04 crystal
x = -( GetNPhi()/2. - Row + 0.5 ) * GetCrystalSize(0) ; // position ox Xtal with respect
- z = -( GetNZ() /2. - Column + 0.5 ) * GetCrystalSize(2) ; // of center of PHOS module
+ z = ( GetNZ() /2. - Column + 0.5 ) * GetCrystalSize(2) ; // of center of PHOS module
}
else {
if ( RelId[1] > GetNumberOfModulesPhi() * GetNumberOfModulesZ() )
Float_t x0 = ( GetNumberOfModulesPhi() / 2. - ModRow + 0.5 ) * GetPPSDModuleSize(0) ;
Float_t z0 = ( GetNumberOfModulesZ() / 2. - ModCol + 0.5 ) * GetPPSDModuleSize(2) ;
x = - ( GetNumberOfPadsPhi()/2. - Row - 0.5 ) * PadSizeX + x0 ; // position of pad with respect
- z = - ( GetNumberOfPadsZ()/2. - Column - 0.5 ) * PadSizeZ + z0 ; // of center of PHOS module
+ z = ( GetNumberOfPadsZ()/2. - Column - 0.5 ) * PadSizeZ - z0 ; // of center of PHOS module
}
}
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/* $Id$ */
+
////////////////////////////////////////////////
// Geometry class for PHOS : singleton //
// Version SUBATECH //
// Modified by Y. Schutz SUBATECH //
////////////////////////////////////////////////
+/* $Id$ */
+
// --- ROOT system ---
// --- AliRoot header files ---
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/* $Id$ */
+
////////////////////////////////////////////////
// Short description //
// Version SUBATECH //
--- /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. *
+ **************************************************************************/
+
+//_________________________________________________________________________
+// To guess the type of particle detected in PHOS with or without the help
+// from other detectors
+//*-- Author : Yves Schutz SUBATECH
+//////////////////////////////////////////////////////////////////////////////
+
+// --- ROOT system ---
+
+
+
+// --- Standard library ---
+
+
+
+// --- AliRoot header files ---
+
+#include "AliPHOSParticleGuesser.h"
+
+ClassImp(AliPHOSParticleGuesser)
+
+//____________________________________________________________________________
+AliPHOSParticleGuesser::AliPHOSParticleGuesser()
+{
+ // ctor
+}
+
+//____________________________________________________________________________
+AliPHOSParticleGuesser::~AliPHOSParticleGuesser()
+{
+ // dtor
+}
--- /dev/null
+#ifndef ALIPHOSPARTICLEGUESSER_H
+#define ALIPHOSPARTICLEGUESSER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+////////////////////////////////////////////////
+// Algorithme class for the guess of //
+// particles detected in PHOS //
+// interface class //
+// Version SUBATECH //
+// Author Yves Schutz SUBATECH //
+// //
+// pABC //
+////////////////////////////////////////////////
+
+// --- ROOT system ---
+
+#include "TObject.h"
+#include "TClonesArray.h"
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+
+#include "AliPHOSTrackSegmentMaker.h"
+
+
+typedef TClonesArray RecParticlesList ;
+
+class AliPHOSParticleGuesser : public TObject {
+
+public:
+
+ AliPHOSParticleGuesser() ; // ctor
+ virtual ~AliPHOSParticleGuesser() ; // dtor
+
+ virtual void GuessParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl) {} ;
+
+ ClassDef(AliPHOSParticleGuesser,1) // Particle Guesser interface, version 1
+
+} ;
+
+#endif // ALIPHOSPARTICLEGUESSER_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. *
+ **************************************************************************/
+
+//_________________________________________________________________________
+// Algorithm class to guess the type of particle from the PHOS TrackSegment alone
+//*-- Author : Y. Schutz SUBATECH
+//////////////////////////////////////////////////////////////////////////////
+
+// --- ROOT system ---
+
+// --- Standard library ---
+
+#include <iostream>
+
+// --- AliRoot header files ---
+
+#include "AliPHOSParticleGuesserv1.h"
+#include "AliPHOSTrackSegment.h"
+#include "AliPHOSRecParticle.h"
+
+ClassImp( AliPHOSParticleGuesserv1)
+
+
+//____________________________________________________________________________
+ AliPHOSParticleGuesserv1::AliPHOSParticleGuesserv1()
+{
+ // ctor
+
+}
+
+//____________________________________________________________________________
+ AliPHOSParticleGuesserv1::~AliPHOSParticleGuesserv1()
+{
+ // dtor
+}
+
+
+//____________________________________________________________________________
+void AliPHOSParticleGuesserv1::GuessParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl)
+{
+ // main function, does the job
+
+ TIter next(trsl) ;
+ AliPHOSTrackSegment * tracksegment ;
+ Int_t index = 0 ;
+
+ while ( (tracksegment = (AliPHOSTrackSegment *)next()) ) {
+ new( (*rpl)[index] ) AliPHOSRecParticle(tracksegment) ;
+ index++ ;
+ }
+
+}
+
--- /dev/null
+#ifndef ALIPHOSPARTICLEGUESSERV1_H
+#define ALIPHOSPARTICLEGUESSERV1_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////
+// Particle Guesser class for PHOS //
+// Version SUBATECH //
+// Author Yves Schutz //
+// comment: guess the type of particle //
+// PHOS SubTrack alone //
+///////////////////////////////////////////////////
+
+// --- ROOT system ---
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+
+#include "AliPHOSParticleGuesser.h"
+
+class AliPHOSParticleGuesserv1 : public AliPHOSParticleGuesser {
+
+public:
+
+ AliPHOSParticleGuesserv1() ;
+ virtual ~ AliPHOSParticleGuesserv1() ; // dtor
+
+ void GuessParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl ) ; // does the job
+
+
+private:
+
+public:
+
+ClassDef( AliPHOSParticleGuesserv1,1) // particle guesser implementation , version 1
+
+};
+
+#endif // AliPHOSPARTICLEGUESSERV1_H
AliPHOSDigit * digit ;
Int_t iDigit;
- for(iDigit=0; iDigit<fMulDigit; iDigit++) {
+ for(iDigit = 0; iDigit < fMulDigit; iDigit++) {
digit = (AliPHOSDigit *) fDigitsList[iDigit];
Float_t xi ;
z += zi ;
}
- x /= fMulDigit ;
- z /= fMulDigit ;
+ x /= fMulDigit ;
+ z /= fMulDigit ;
fLocPos.SetX(x) ;
fLocPos.SetY(0.) ;
fLocPos.SetZ(z) ;
LPos = fLocPos ;
+
}
//____________________________________________________________________________
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/* $Id$ */
+
////////////////////////////////////////////////
// Cluster in the PPSD of PHOS //
// Version SUBATECH //
Int_t Compare(TObject * obj) ; // method to sort clusters
Float_t GetDelta(void) {return fDelta ;}
- Int_t GetMultiplicity(void) const { return fMulDigit ; }
- Int_t GetMaximumMultiplicity() { return fMaxDigit ; }
- void GetLocalPosition(TVector3 &LPos) ; // computes the position in the module of the cluster center
- //projection of ALICE axes on PHOS Module, y = 0 .
- Bool_t GetUp() ; // true if cluster is in upper ppsd
- Bool_t IsEmc(void) {return kFALSE ; }
- Bool_t IsSortable() const { return kTRUE ; }
+ Int_t GetMultiplicity(void) const { return fMulDigit ; }
+ Int_t GetMaximumMultiplicity() { return fMaxDigit ; }
+ void GetLocalPosition(TVector3 &LPos) ; // computes the position in the module of the cluster center
+ Float_t GetTotalEnergy(void) const { return fAmp ; } // in Ppsd EMC RecPoint Amp = Energy //projection of ALICE axes on PHOS Module, y = 0 .
+ Bool_t GetUp() ; // true if cluster is in upper ppsd
+ Bool_t IsEmc(void) {return kFALSE ; }
+ Bool_t IsSortable() const { return kTRUE ; }
virtual void Paint(Option_t * option="");
- void Print(Option_t * opt = "void") ;
+ void Print(Option_t * opt = "void") ;
// AliPHOSPpsdRecPoint& operator = (AliPHOSPpsdRecPoint Clu) ;
--- /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. *
+ **************************************************************************/
+
+//_________________________________________________________________________
+// Reconstructed Particle
+//*-- Y. Schutz: SUBATECH
+//////////////////////////////////////////////////////////////////////////////
+
+// --- ROOT system ---
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+
+#include "AliPHOSRecParticle.h"
+
+ClassImp(AliPHOSRecParticle)
+
+
+//____________________________________________________________________________
+ AliPHOSRecParticle::AliPHOSRecParticle(AliPHOSTrackSegment * ts)
+{
+ // ctor
+
+ fPHOSTrackSegment = new AliPHOSTrackSegment(*ts) ;
+ fType = ts->GetPartType() ;
+ fE = ts->GetEnergy() ;
+ TVector3 momdir = ts->GetMomentumDirection() ;
+ fPx = fE * momdir.X() ;
+ fPy = fE * momdir.Y() ;
+ fPz = fE * momdir.Z() ;
+
+}
+
+//____________________________________________________________________________
+TString AliPHOSRecParticle::Name()
+{
+ TString name ;
+ switch (fType) {
+ case GAMMA :
+ name = "PHOTON" ;
+ break ;
+ case ELECTRON :
+ name = "ELECTRON" ;
+ break ;
+ case NEUTRAL :
+ name = "NEUTRAL" ;
+ break ;
+ case CHARGEDHADRON:
+ name = "CHARGED HADRON" ;
+ break ;
+ }
+ return name ;
+}
+
+//____________________________________________________________________________
+void AliPHOSRecParticle::Print()
+{
+ cout << "AliPHOSRecParticle > " << "type is " << Name() << endl
+ << " " << "Energy = " << fE << endl
+ << " " << "Px = " << fPx << endl
+ << " " << "Py = " << fPy << endl
+ << " " << "Pz = " << fPz << endl ;
+}
--- /dev/null
+#ifndef ALIPHOSRECPARTICLE_H
+#define ALIPHOSRECPARTICLE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+////////////////////////////////////////////////
+// A Reconstructed Particle in PHOS //
+// Yves Schutz SUBATECH //
+// To become a general class of AliRoot ? //
+// //
+////////////////////////////////////////////////
+
+// --- ROOT system ---
+
+#include "TParticle.h"
+#include "TVector3.h"
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+
+#include "AliPHOSTrackSegment.h"
+
+class AliPHOSRecParticle : public TParticle {
+
+public:
+
+ AliPHOSRecParticle() {}; // ctor
+ AliPHOSRecParticle(AliPHOSTrackSegment * ts) ; // ctor
+
+ virtual ~AliPHOSRecParticle(){} ; // dtor
+
+ AliPHOSTrackSegment * GetPHOSTrackSegment() { return fPHOSTrackSegment ; }
+ Int_t GetType() { return fType ; }
+ TString Name() ;
+ void Print() ;
+
+private:
+
+ AliPHOSTrackSegment * fPHOSTrackSegment ; // pointer to the associated track segment in PHOS
+ Int_t fType ; // guessed particle type
+
+public:
+
+ClassDef(AliPHOSRecParticle,1) // Reconstructed Particle, version 1
+
+};
+
+#endif // AliPHOSRECPARTICLE_H
//____________________________________________________________________________
Int_t AliPHOSRecPoint::DistancetoPrimitive(Int_t px, Int_t py)
{
-//*-*-*-*-*-*-*-*-*-*-*Compute distance from point px,py to a AliPHOSRecPoint considered as a Tmarker*-*-*-*-*-*
-//*-* ===========================================
-// Compute the closest distance of approach from point px,py to this marker.
-// The distance is computed in pixels units.
-//
+ //Compute distance from point px,py to a AliPHOSRecPoint considered as a Tmarker
+ // Compute the closest distance of approach from point px,py to this marker.
+ // The distance is computed in pixels units.
+ //
TVector3 pos(0.,0.,0.) ;
GetLocalPosition( pos) ;
if (dist > kMaxDiff) return 9999;
return dist;
}
+
//___________________________________________________________________________
void AliPHOSRecPoint::Draw(Option_t *option)
{
-// //*-*-*-*-*-*-*-*-*-*-*Draw this AliPHOSRecPoint with its current attributes*-*-*-*-*-*-*
-// //*-*
- // assert(0==1);
- AppendPad(option);
+ // Draw this AliPHOSRecPoint with its current attributes
+
+ AppendPad(option);
}
//______________________________________________________________________________
void AliPHOSRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py)
{
-//*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*
-//*-* =========================================
-// This member function is called when a AliPHOSRecPoint is clicked with the locator
-//
-// If Left button is clicked on AliPHOSRecPoint, the digits are switched on
-// and switched off when the mouse button is released.
-//
+ // Execute action corresponding to one event
+ // This member function is called when a AliPHOSRecPoint is clicked with the locator
+ //
+ // If Left button is clicked on AliPHOSRecPoint, the digits are switched on
+ // and switched off when the mouse button is released.
+ //
// static Int_t pxold, pyold;
//____________________________________________________________________________
Int_t AliPHOSRecPoint::GetPHOSMod()
{
- if(fPHOSMod > 0) return fPHOSMod ;
+ if(fPHOSMod > 0)
+ return fPHOSMod ;
+
Int_t relid[4] ;
AliPHOSDigit * digit ;
fPHOSMod = relid[0];
return fPHOSMod ;
}
+
//______________________________________________________________________________
void AliPHOSRecPoint::Paint(Option_t *)
{
-//*-*-*-*-*-*-*-*-*-*-*Paint this ALiRecPoint as a TMarker with its current attributes*-*-*-*-*-*-*
-//*-* =============================================
+// Paint this ALiRecPoint as a TMarker with its current attributes
+
TVector3 pos(0.,0.,0.) ;
GetLocalPosition(pos) ;
Coord_t x = pos.X() ;
}
//____________________________________________________________________________
-AliPHOSReconstructioner::AliPHOSReconstructioner(AliPHOSClusterizer & Clusterizer, AliPHOSTrackSegmentMaker & Tracker)
+AliPHOSReconstructioner::AliPHOSReconstructioner(AliPHOSClusterizer * Clusterizer,
+ AliPHOSTrackSegmentMaker * Tracker,
+ AliPHOSParticleGuesser * Guesser)
{
- fClusterizer = &Clusterizer ;
- fTrackSegmentMaker = &Tracker ;
+ fClusterizer = Clusterizer ;
+ fTrackSegmentMaker = Tracker ;
+ fParticleGuesser = Guesser ;
}
//____________________________________________________________________________
AliPHOSReconstructioner::~AliPHOSReconstructioner()
{
// dtor
- fClusterizer = 0 ;
- fTrackSegmentMaker = 0 ;
}
//____________________________________________________________________________
-void AliPHOSReconstructioner::Make(TClonesArray * dl, RecPointsList * emccl, RecPointsList * ppsdl, TrackSegmentsList * trsl)
+ void AliPHOSReconstructioner::Init(AliPHOSClusterizer * Clusterizer,
+ AliPHOSTrackSegmentMaker * Tracker,
+ AliPHOSParticleGuesser * Guesser)
+{
+ fClusterizer = Clusterizer ;
+ fTrackSegmentMaker = Tracker ;
+ fParticleGuesser = Guesser ;
+}
+
+
+
+//____________________________________________________________________________
+ void AliPHOSReconstructioner::Make(TClonesArray * dl, RecPointsList * emccl, RecPointsList * ppsdl,
+ TrackSegmentsList * trsl, RecParticlesList * rpl)
{
- cout << "Make1" << endl;
fClusterizer->MakeClusters(dl, emccl, ppsdl);
- cout << "Make2" << endl;
+
fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, trsl) ;
- cout << "Make3" << endl;
+
+ fParticleGuesser->GuessParticleType(trsl, rpl) ;
}
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/* $Id$ */
+
////////////////////////////////////////////////
// Algorithme class for the reconstruction //
// //
// Author Gines MARTINEZ SUBATECH //
+// //
+// january 2000: added Particle guesser (YS) //
// //
// //
////////////////////////////////////////////////
#include "TObject.h"
#include "AliPHOSClusterizer.h"
#include "AliPHOSTrackSegmentMaker.h"
+#include "AliPHOSParticleGuesser.h"
#include "TClonesArray.h"
// --- Standard library ---
public:
AliPHOSReconstructioner(); //ctor
- AliPHOSReconstructioner(AliPHOSClusterizer& Clusterizer, AliPHOSTrackSegmentMaker& Tracker); //ctor
+ AliPHOSReconstructioner(AliPHOSClusterizer * Clusterizer, AliPHOSTrackSegmentMaker * Tracker,
+ AliPHOSParticleGuesser * Guesser); //ctor
~AliPHOSReconstructioner(); // dtor
AliPHOSClusterizer * GetClusterizer() { return fClusterizer ; }
- void Make(TClonesArray * DL, RecPointsList * emccl, RecPointsList * ppsdl, TrackSegmentsList * trsl) ; // does the job
+ void Init(AliPHOSClusterizer * Clusterizer, AliPHOSTrackSegmentMaker * Tracker,
+ AliPHOSParticleGuesser * Guesser) ;
+ void Make(TClonesArray * DL, RecPointsList * emccl, RecPointsList * ppsdl,
+ TrackSegmentsList * trsl, RecParticlesList * rpl) ; // does the job
private:
AliPHOSClusterizer * fClusterizer ; // Method for clusterization
- AliPHOSTrackSegmentMaker * fTrackSegmentMaker ; // Method for track segments finding
+ AliPHOSTrackSegmentMaker * fTrackSegmentMaker ; // Method for track segments finding
+ AliPHOSParticleGuesser * fParticleGuesser ; // Method for guessing the type of particle
public:
fCutOnDispersion = 1.5 ;
}
+//____________________________________________________________________________
+AliPHOSTrackSegment::AliPHOSTrackSegment( const AliPHOSTrackSegment & ts)
+{
+ ( (AliPHOSTrackSegment &)ts ).Copy(*this) ;
+}
+
//____________________________________________________________________________
AliPHOSTrackSegment::~AliPHOSTrackSegment() // dtor
{
// fPpsdLow.Delete() ;
}
+//____________________________________________________________________________
+void AliPHOSTrackSegment::Copy(TObject & obj)
+{
+ TObject::Copy(obj) ;
+ ( (AliPHOSTrackSegment &)obj ).fEmcRecPoint = fEmcRecPoint ;
+ ( (AliPHOSTrackSegment &)obj ).fPpsdLow = fPpsdLow ;
+ ( (AliPHOSTrackSegment &)obj ).fPpsdUp = fPpsdUp ;
+}
//____________________________________________________________________________
Int_t AliPHOSTrackSegment::DistancetoPrimitive(Int_t px, Int_t py)
{
-//*-*-*-*-*-*-*-*-*-*-*Compute distance from point px,py to a AliPHOSTrackSegment considered as a Tmarker*-*-*-*-*-*
-//*-* ===========================================
-// Compute the closest distance of approach from point px,py to this marker.
-// The distance is computed in pixels units.
-//
-
- TVector3 pos(0.,0.,0.) ;
- fEmcRecPoint->GetLocalPosition( pos) ;
- Float_t x = pos.X() ;
- Float_t y = pos.Z() ;
+ //Compute distance from point px,py to a AliPHOSTrackSegment considered as a Tmarker
+ // Compute the closest distance of approach from point px,py to this marker.
+ // The distance is computed in pixels units.
+ //
+ Int_t div = 1 ;
+ TVector3 pos(0.,0.,0.) ;
+
+ fEmcRecPoint->GetLocalPosition( pos) ;
+ Float_t x = pos.X() ;
+ Float_t y = pos.Z() ;
+ if ( fPpsdLow ) {
+ fPpsdLow->GetLocalPosition( pos ) ;
+ x += pos.X() ;
+ y += pos.Z() ;
+ div++ ;
+ }
+ if ( fPpsdUp ) {
+ fPpsdUp->GetLocalPosition( pos ) ;
+ x += pos.X() ;
+ y += pos.Z() ;
+ div++ ;
+ }
+ x /= div ;
+ y /= div ;
+
const Int_t kMaxDiff = 10;
Int_t pxm = gPad->XtoAbsPixel(x);
Int_t pym = gPad->YtoAbsPixel(y);
//___________________________________________________________________________
void AliPHOSTrackSegment::Draw(Option_t *option)
{
-// //*-*-*-*-*-*-*-*-*-*-*Draw this AliPHOSTrackSegment with its current attributes*-*-*-*-*-*-*
-// //*-*
- // assert(0==1);
- AppendPad(option);
+ // Draw this AliPHOSTrackSegment with its current attribute
+
+ AppendPad(option);
}
//______________________________________________________________________________
void AliPHOSTrackSegment::ExecuteEvent(Int_t event, Int_t px, Int_t py)
{
-//*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*
-//*-* =========================================
-// This member function is called when a AliPHOSTrackSegment is clicked with the locator
-//
-// If Left button is clicked on AliPHOSRecPoint, the digits are switched on
-// and switched off when the mouse button is released.
-//
+ // Execute action corresponding to one event
+ // This member function is called when a AliPHOSTrackSegment is clicked with the locator
+ //
+ // If Left button is clicked on AliPHOSRecPoint, the digits are switched on
+ // and switched off when the mouse button is released.
+ //
static TPaveText* TrackSegmentText = 0 ;
- if (!gPad->IsEditable()) return;
+ if (!gPad->IsEditable())
+ return;
switch (event) {
TVector3 pos(0.,0.,0.) ;
fEmcRecPoint->GetLocalPosition(pos) ;
- TrackSegmentText = new TPaveText(pos.X()-10,pos.Z()+10,pos.X()+50,pos.Z()+35,"") ;
+ TrackSegmentText = new TPaveText(pos.X()-10,pos.Z()+10,pos.X()+5,pos.Z()+15,"") ;
Text_t line1[40] ;
- if (GetPartType() == 0 ) sprintf(line1,"PHOTON") ;
- if (GetPartType() == 1 ) sprintf(line1,"NEUTRAL HADRON") ;
- if (GetPartType() == 2 ) sprintf(line1,"CHARGED HADRON") ;
- if (GetPartType() == 3 ) sprintf(line1,"ELECTRON") ;
+ if (GetPartType() == GAMMA )
+ sprintf(line1,"PHOTON") ;
+ if (GetPartType() == ELECTRON )
+ sprintf(line1,"ELECTRON") ;
+ if (GetPartType() == NEUTRAL )
+ sprintf(line1,"NEUTRAL") ;
+ if (GetPartType() == CHARGEDHADRON )
+ sprintf(line1,"CHARGED HADRON") ;
+
TrackSegmentText ->AddText(line1) ;
- TrackSegmentText ->Paint("");
+ TrackSegmentText ->Draw("");
+ gPad->Update() ;
}
}
}
//____________________________________________________________________________
-Bool_t AliPHOSTrackSegment::GetMomentumDirection( TVector3 & dir )
+TVector3 AliPHOSTrackSegment::GetMomentumDirection()
{
- // True if determined
- Bool_t ifdeterm = kTRUE ;
-
- if( fPpsdLow ){
- TMatrix mdummy ;
- if( fPpsdUp->GetMultiplicity() ) { // draw line trough 2 points
- TVector3 posEmc ;
- fEmcRecPoint->GetGlobalPosition(posEmc,mdummy) ;
- TVector3 posPpsd ;
- fPpsdLow->GetGlobalPosition(posPpsd,mdummy) ;
- dir = posEmc - posPpsd ;
- dir.SetMag(1.) ;
- }
+ TVector3 dir, tempo ;
+ TMatrix mdummy ;
- else { // draw line through 3 pionts
- TVector3 posEmc ;
- fEmcRecPoint->GetGlobalPosition(posEmc,mdummy) ;
- TVector3 posPpsdl ;
- fPpsdLow->GetGlobalPosition(posPpsdl,mdummy) ;
- TVector3 posPpsdup ;
- fPpsdUp->GetGlobalPosition(posPpsdup,mdummy) ;
- posPpsdl = 0.5*( posPpsdup+posPpsdl ) ;
- dir = posEmc - posPpsdl ;
- dir.SetMag(1.) ;
- }
-
- }
- else
- ifdeterm = kFALSE ;
+ TVector3 posEmc ;
+ fEmcRecPoint->GetGlobalPosition(posEmc, mdummy) ;
+
+ TVector3 posPpsdl ;
+ TVector3 posPpsdup ;
- return ifdeterm ;
+// if( fPpsdLow ){
+// fPpsdLow->GetGlobalPosition(posPpsdl, mdummy) ;
+// if( !fPpsdUp ) { // draw line trough 2 points
+// tempo = posEmc - posPpsdl;
+// }
+
+// else { // draw line through 3 points
+// fPpsdUp->GetGlobalPosition(posPpsdup, mdummy) ;
+// posPpsdl = 0.5 * ( posPpsdup + posPpsdl ) ;
+// dir = posEmc - posPpsdl ;
+// }
+// }
+// else
+ tempo = posEmc ;
+
+ dir.SetX( tempo.X() ) ; // assumes that a neutral comes from the vertex
+ dir.SetY( tempo.Y() ) ;
+ dir.SetZ( -tempo.Z() ) ;
+
+ dir.SetMag(1.) ;
+ return dir ;
}
//____________________________________________________________________________
{
// Returns 0 - gamma
// 1 - e+, e-
- // 2 - neutral hadron
+ // 2 - neutral
// 3 - charged hadron
- Int_t PartType =0;
- if( fPpsdUp ){ // Neutral
+ Int_t PartType = GAMMA ;
+
+ if( fPpsdUp == 0 ) { // Neutral
- if( fPpsdLow ) // Neutral hadron
- PartType = 2 ;
- else // Gamma
- PartType = 0 ;
+ if( fPpsdLow == 0 ) // Neutral
+ PartType = NEUTRAL ;
+ else // Gamma
+ PartType = GAMMA ;
}
else { // Charged
if( fEmcRecPoint->GetDispersion() > fCutOnDispersion)
- PartType = 3 ;
+ PartType = CHARGEDHADRON ;
else
- PartType = 1 ;
+ PartType = ELECTRON ;
}
//______________________________________________________________________________
void AliPHOSTrackSegment::Paint(Option_t *)
{
-//*-*-*-*-*-*-*-*-*-*-*Paint this ALiPHOSTrackSegment as a TMarker with its current attributes*-*-*-*-*-*-*
-//*-* =============================================
- TVector3 pos(0.,0.,0.) ;
- fEmcRecPoint->GetLocalPosition(pos) ;
- Coord_t x = pos.X() ;
- Coord_t y = pos.Z() ;
- Color_t MarkerColor = 1 ;
- Size_t MarkerSize = 1. ;
- Style_t MarkerStyle = 29 ;
+ //Paint this ALiPHOSTrackSegment as a TMarker with its current attributes
+
+ TVector3 posemc(999., 999., 999.) ;
+ TVector3 posppsdl(999., 999., 999.) ;
+ TVector3 posppsdu(999., 999., 999.) ;
+
+ fEmcRecPoint->GetLocalPosition(posemc) ;
+ if (fPpsdLow !=0 )
+ fPpsdLow->GetLocalPosition(posppsdl) ;
+ if (fPpsdUp !=0 )
+ fPpsdUp->GetLocalPosition(posppsdu) ;
+
+ Coord_t xemc = posemc.X() ;
+ Coord_t yemc = posemc.Z() ;
- if (GetPartType() == 0 ) MarkerStyle = 20 ;
- if (GetPartType() == 1 ) MarkerStyle = 21 ;
- if (GetPartType() == 2 ) MarkerStyle = 22 ;
- if (GetPartType() == 3 ) MarkerStyle = 23 ;
+ Coord_t yppsdl = posppsdl.Z() ;
+ Coord_t xppsdl = posppsdl.X() ;
+
+ Coord_t yppsdu = posppsdu.Z() ;
+ Coord_t xppsdu = posppsdu.X() ;
+
+ Color_t MarkerColor = 1 ;
+ Size_t MarkerSize = 1.5 ;
+ Style_t MarkerStyle = 20 ;
if (!gPad->IsBatch()) {
gVirtualX->SetMarkerColor(MarkerColor) ;
gVirtualX->SetMarkerStyle(MarkerStyle) ;
}
gPad->SetAttMarkerPS(MarkerColor,MarkerStyle,MarkerSize) ;
- gPad->PaintPolyMarker(1,&x,&y,"") ;
+ gPad->PaintPolyMarker(1, &xemc, &yemc, "") ;
+
+ if (xppsdl != 999. && yppsdl != 999. ) {
+
+ MarkerColor = 2 ;
+ MarkerSize = 1.25 ;
+ MarkerStyle = 21 ;
+
+ if (!gPad->IsBatch()) {
+ gVirtualX->SetMarkerColor(MarkerColor) ;
+ gVirtualX->SetMarkerSize (MarkerSize) ;
+ gVirtualX->SetMarkerStyle(MarkerStyle) ;
+ }
+ gPad->SetAttMarkerPS(MarkerColor,MarkerStyle,MarkerSize) ;
+ gPad->PaintPolyMarker(1, &xppsdl, &yppsdl, "") ;
+ }
+
+ if (xppsdu != 999. && yppsdu != 999. ) {
+
+ MarkerColor = 3 ;
+ MarkerSize = 1. ;
+ MarkerStyle = 22 ;
+
+ if (!gPad->IsBatch()) {
+ gVirtualX->SetMarkerColor(MarkerColor) ;
+ gVirtualX->SetMarkerSize (MarkerSize) ;
+ gVirtualX->SetMarkerStyle(MarkerStyle) ;
+ }
+ gPad->SetAttMarkerPS(MarkerColor,MarkerStyle,MarkerSize) ;
+ gPad->PaintPolyMarker(1, &xppsdu, &yppsdu, "") ;
+ }
}
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/* $Id$ */
+
/////////////////////////////////////////////////
// Short description //
// Version SUBATECH //
#include "AliPHOSEmcRecPoint.h"
#include "AliPHOSPpsdRecPoint.h"
-
+const static Int_t GAMMA = 0 ;
+const static Int_t ELECTRON = 1 ;
+const static Int_t NEUTRAL = 2 ;
+const static Int_t CHARGEDHADRON = 3 ;
class AliPHOSTrackSegment : public TObject {
public:
- AliPHOSTrackSegment() {} ; // ctor
+ AliPHOSTrackSegment() {} ; // ctor
AliPHOSTrackSegment(AliPHOSEmcRecPoint * EmcRecPoint , AliPHOSPpsdRecPoint * PpsdUp,
- AliPHOSPpsdRecPoint * PpsdLow ) ;
+ AliPHOSPpsdRecPoint * PpsdLow ) ; // ctor
+ AliPHOSTrackSegment(const AliPHOSTrackSegment & ts) ; // ctor
virtual ~AliPHOSTrackSegment() ; // dtor
+ void Copy(TObject & obj) ;
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
virtual void Draw(Option_t * option="") ;
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
- Int_t GetPartType() ; // Returns 0 - gamma, 1 - e+, e- ; 2 - neutral hadron ; 3 - charged hadron
- Float_t GetEnergy(){ return fEmcRecPoint->GetTotalEnergy() ;} // Returs energy in EMC
+ Int_t GetPartType() ; // Returns 0 - gamma, 1 - e+, e- ; 2 - neutral hadron ; 3 - charged hadron
+ Float_t GetEnergy(){ return fEmcRecPoint->GetTotalEnergy() ;} // Returns energy in EMC
- Float_t GetDistanceInPHOSPlane(void) ; // computes in PHOS plane the relative position between EMC and PPSD clusters
+ Float_t GetDistanceInPHOSPlane(void) ; // Computes in PHOS plane the relative position between EMC and PPSD clusters
virtual Int_t GetPHOSMod(void) {return fEmcRecPoint->GetPHOSMod(); }
- Bool_t GetMomentumDirection( TVector3 & dir ) ; // True if determined
- void GetPosition( TVector3 & pos ) ; // Returns positions of hits
+ TVector3 GetMomentumDirection() ; // Returns the momentum direction
+ void GetPosition( TVector3 & pos ) ; // Returns positions of hit
virtual void Paint(Option_t * option="");
void Print() ;
void SetDispersionCutOff(Float_t Dcut) {fCutOnDispersion = Dcut ; }
fR0 = 4. ;
}
-//____________________________________________________________________________
-void AliPHOSTrackSegmentMaker::MakeTrackSegments(DigitsList * DL, RecPointsList * emcl, RecPointsList * ppsdl,
- TrackSegmentsList * trsl)
-{
-
-}
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/* $Id$ */
+
///////////////////////////////////////////////////
// Subtrackin class for PHOS //
// Version SUBATECH //
public:
- AliPHOSTrackSegmentMaker() ;
+ AliPHOSTrackSegmentMaker() ;
virtual ~ AliPHOSTrackSegmentMaker(){} // dtor
- virtual void MakeTrackSegments(DigitsList * DL, RecPointsList * emcl, RecPointsList * ppsdl, TrackSegmentsList * trsl ) ;
- // does the job
+ virtual void MakeTrackSegments(DigitsList * DL, RecPointsList * emcl, RecPointsList * ppsdl, TrackSegmentsList * trsl ) = 0 ;
+ // does the job
virtual void SetMaxEmcPpsdDistance(Float_t r){ fR0 = r ;}
private:
+
Float_t fR0 ;
public:
Bool_t AliPHOSTrackSegmentMakerv1::FindFit(AliPHOSEmcRecPoint * emcRP, int * maxAt, Float_t * maxAtEnergy,
Int_t NPar, Float_t * FitParameters)
{
- // gObjectTable->Print() ;
// Calls TMinuit for fitting cluster with several maxima
+
AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ;
- assert( NPar < 100 ) ;
gMinuit->SetPrintLevel(-1) ; // No Printout
gMinuit->SetFCN(UnfoldingChiSquare) ; // To set the address of the minimization function
Int_t iDigit ;
- for(iDigit = 0 ; iDigit < NDigits ; iDigit++){
+ for(iDigit = 0; iDigit < NDigits; iDigit++){
digit = (AliPHOSDigit *) maxAt[iDigit];
Int_t RelId[4] ;
if(ierflg != 0){
cout << "PHOS Unfolding> Unable to set initial value for fit procedure : Energy = " << Energy << endl ;
return kFALSE;
-}
+ }
}
Double_t p0 = 0.1 ; // "Tolerance" Evaluation stops when EDM = 0.0001*p0 ; The number of function call slightly
AliPHOSEmcRecPoint * emcRecPoint ;
AliPHOSPpsdRecPoint * ppsdRecPoint ;
Int_t index ;
- cout << "Fill 1" << endl ;
+
Int_t NemcUnfolded = emcIn->GetEntries() ;
for(index = emcStopedAt; index < NemcUnfolded; index++){
emcRecPoint = (AliPHOSEmcRecPoint *) (*emcIn)[index] ;
- cout << "Fill 2" << endl ;
-
+
if(emcRecPoint->GetPHOSMod() != PHOSMod )
break ;
-
Int_t NMultipl = emcRecPoint->GetMultiplicity() ;
- int maxAt[NMultipl] ;
+ Int_t maxAt[NMultipl] ;
Float_t maxAtEnergy[NMultipl] ;
Int_t Nmax = emcRecPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy) ;
-
-
- if(Nmax <= 1) // if cluster is very flat, so that no prononsed maximum, then Nmax = 0
+ if(Nmax <= 1) // if cluster is very flat (no pronounced maximum) then Nmax = 0
emcOut->Add(emcRecPoint) ;
else {
UnfoldClusters(Dl, emcIn, emcRecPoint, Nmax, maxAt, maxAtEnergy, emcOut) ;
emcIn->Remove(emcRecPoint);
- cout << "Fill 3" << endl ;
emcIn->Compress() ;
NemcUnfolded-- ;
index-- ;
ppsdOutLow->Add(ppsdRecPoint) ;
}
ppsdStopedAt = index ;
-
- PHOSMod ++ ;
-
+
emcOut->Sort() ;
ppsdOutUp->Sort() ;
- ppsdOutLow->Sort() ;
-
+ ppsdOutLow->Sort() ;
}
//____________________________________________________________________________
Float_t AliPHOSTrackSegmentMakerv1::GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * EmcClu,AliPHOSPpsdRecPoint * PpsdClu, Bool_t &TooFar)
if(vecPpsd.X() >= vecEmc.X() - fDelta ){
if(vecPpsd.Z() >= vecEmc.Z() - fDelta ){
AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ;
- //Correct to difference in CPV and EMC position due to different distance to center.
- //we assume, that particle moves from center
+ // Correct to difference in CPV and EMC position due to different distance to center.
+ // we assume, that particle moves from center
Float_t DCPV = geom->GetIPtoOuterCoverDistance();
Float_t DEMC = geom->GetIPtoCrystalSurface() ;
DEMC = DEMC / DCPV ;
void AliPHOSTrackSegmentMakerv1::MakePairs(TObjArray * EmcRecPoints, TObjArray * PpsdRecPointsUp,
TObjArray * PpsdRecPointsLow, TClonesArray * LinkLowArray,
TClonesArray * LinkUpArray, TrackSegmentsList * trsl)
-{ // Finds the smallest links and makes pairs of PPSD and EMC clusters with smallest distance
+{
+
+ // Finds the smallest links and makes pairs of PPSD and EMC clusters with smallest distance
+
TIter nextLow(LinkLowArray) ;
TIter nextUp(LinkUpArray) ;
while ( (linkLow = (AliPHOSLink *)nextLow() ) ){
emc = (AliPHOSEmcRecPoint *) EmcRecPoints->At(linkLow->GetEmc()) ;
ppsdLow = (AliPHOSPpsdRecPoint *) PpsdRecPointsLow->At(linkLow->GetPpsd()) ;
- if((emc)&&(ppsdLow)){ // RecPoints not removed yet
+ if( (emc) && (ppsdLow) ){ // RecPoints not removed yet
ppsdUp = 0 ;
while ( (linkUp = (AliPHOSLink *)nextUp() ) ){
if(ppsdUp)
PpsdRecPointsUp->AddAt(NullPointer,linkUp->GetPpsd()) ;
- } // if NLocMax
+ }
}
TIter nextEmc(EmcRecPoints) ;
AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ;
while(PHOSMod <= geom->GetNModules() ){
-
- cout << PHOSMod << " Track1 " << endl ;
- FillOneModule(DL, emcl, EmcRecPoints, ppsdl, PpsdRecPointsUp, PpsdRecPointsLow, PHOSMod , emcStopedAt, ppsdStopedAt) ;
- cout << PHOSMod << " Track2 " << endl ;
+ FillOneModule(DL, emcl, EmcRecPoints, ppsdl, PpsdRecPointsUp, PpsdRecPointsLow, PHOSMod, emcStopedAt, ppsdStopedAt) ;
+
MakeLinks(EmcRecPoints, PpsdRecPointsUp, PpsdRecPointsLow, LinkLowArray, LinkUpArray) ;
- cout << PHOSMod << " Track3 " << endl ;
MakePairs(EmcRecPoints, PpsdRecPointsUp, PpsdRecPointsLow, LinkLowArray, LinkUpArray, trsl) ;
EmcRecPoints->Clear() ;
PpsdRecPointsLow->Clear() ;
- LinkUpArray->Clear();
+ LinkUpArray->Clear() ;
- LinkLowArray->Clear();
+ LinkLowArray->Clear() ;
+ PHOSMod++ ;
}
delete EmcRecPoints ;
EmcRecPoints = 0 ;
Double_t AliPHOSTrackSegmentMakerv1::ShowerShape(Double_t r)
{
// If you change this function, change also gradiend evaluation in ChiSquare()
- Double_t r4 = r*r*r*r ;
- Double_t r295 = TMath::Power(r, 2.95) ;
+ Double_t r4 = r*r*r*r ;
+ Double_t r295 = TMath::Power(r, 2.95) ;
Double_t shape = TMath::Exp( -r4 * (1. / (2.32 + 0.26 * r4) + 0.0316 / (1 + 0.0652 * r295) ) ) ;
return shape ;
}
AliPHOSDigit * digit ;
AliPHOSEmcRecPoint * emcRP ;
- int * emcDigits = iniEmc->GetDigitsList() ;
+ Int_t * emcDigits = iniEmc->GetDigitsList() ;
Float_t * emcEnergies = iniEmc->GetEnergiesList() ;
Int_t iRecPoint = emcIn->GetEntries() ;
Distance = TMath::Sqrt(Distance) ;
Efit[iDigit] += Epar * ShowerShape(Distance) ;
}
-
}
iparam = 0 ;
}
}
+
//______________________________________________________________________________
-void UnfoldingChiSquare(Int_t &NPar, Double_t *Grad, Double_t & fret, Double_t *x, Int_t iflag)
+void UnfoldingChiSquare(Int_t & NPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag)
{
-// Number of paramters, Gradient , Chi squared, parameters, what to do
+// Number of parameters, Gradient, Chi squared, parameters, what to do
AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ;
AliPHOSEmcRecPoint * emcRP = (AliPHOSEmcRecPoint *) gMinuit->GetObjectFit() ; // EmcRecPoint to fit
- int * emcDigits = emcRP->GetDigitsList() ;
+ Int_t * emcDigits = emcRP->GetDigitsList() ;
Float_t * emcEnergies = emcRP->GetEnergiesList() ;
fret = 0. ;
Int_t iparam ;
-#ifndef ALIPHOSSUBTRACKERV1_H
-#define ALIPHOSSUBTRACKERV1_H
+#ifndef ALIPHOSTRACKSEGMENTMAKERV1_H
+#define ALIPHOSTRACKSEGMENTMAKERV1_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/* $Id$ */
+
///////////////////////////////////////////////////
// Track Segment Maker class for PHOS //
// Version SUBATECH //
};
-#endif // AliPHOSSUBTRACKERV1_H
+#endif // AliPHOSTRACKSEGMENTMAKERV1_H
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-*/
-
//_________________________________________________________________________
// Manager class for PHOS version SUBATECH
//*-- Author : Y. Schutz SUBATECH
// is used for the digitization part.
fHits = new TClonesArray("AliPHOSHit",100) ;
- gAlice->AddHitList(fHits);
- fDigits = new TClonesArray("AliPHOSDigit",100) ;
+ gAlice->AddHitList(fHits) ;
+
fTmpHits= new TClonesArray("AliPHOSHit",100) ;
fNTmpHits = fNhits = 0 ;
+ fDigits = new TClonesArray("AliPHOSDigit",100) ;
+
+
fIshunt = 1 ; // All hits are associated with primary particles
// gets an instance of the geometry parameters class
+
fGeom = AliPHOSGeometry::GetInstance(title, "") ;
if (fGeom->IsInitialized() )
cout << "AliPHOSv0 : PHOS geometry initialization failed !" << endl ;
}
//____________________________________________________________________________
-AliPHOSv0::AliPHOSv0(AliPHOSReconstructioner & Reconstructioner, const char *name, const char *title):
+AliPHOSv0::AliPHOSv0(AliPHOSReconstructioner * Reconstructioner, const char *name, const char *title):
AliPHOS(name,title)
{
// Defining the PHOS Reconstructioner
- fReconstructioner = &Reconstructioner ;
+ fReconstructioner = Reconstructioner ;
}
//____________________________________________________________________________
}
//_____________________________________________________________________________
-void AliPHOSv0::Reconstruction(AliPHOSReconstructioner & Reconstructioner)
+void AliPHOSv0::Reconstruction(AliPHOSReconstructioner * Reconstructioner)
{
// reinitializes the existing RecPoint Lists and steers the reconstruction processes
- fReconstructioner = &Reconstructioner ;
- cout << "Hola1" << endl;
+ fReconstructioner = Reconstructioner ;
+
if (fEmcClusters) {
fEmcClusters->Delete() ;
delete fEmcClusters ;
fEmcClusters = 0 ;
-
}
fEmcClusters= new RecPointsList("AliPHOSEmcRecPoint", 100) ;
- cout << "Hola2" << endl;
if (fPpsdClusters) {
fPpsdClusters->Delete() ;
delete fPpsdClusters ;
}
fPpsdClusters = new RecPointsList("AliPHOSPpsdRecPoint", 100) ;
-
- cout << "Hola3" << endl;
- if (fTrackSegments) {
- fTrackSegments->Print("");
+ if (fTrackSegments) {
fTrackSegments->Delete() ;
delete fTrackSegments ;
fTrackSegments = 0 ;
}
- fTrackSegments = new TObjArray(100) ;
+ fTrackSegments = new TrackSegmentsList(100) ;
+
+ if (fRecParticles) {
+ fRecParticles->Delete() ;
+ delete fRecParticles ;
+ fRecParticles = 0 ;
+ }
+ fRecParticles = new RecParticlesList("AliPHOSRecParticle", 100) ;
+
+ fReconstructioner->Make(fDigits, fEmcClusters, fPpsdClusters, fTrackSegments, fRecParticles);
- cout << "Hola4" << endl;
- fReconstructioner->Make(fDigits, fEmcClusters, fPpsdClusters, fTrackSegments);
- cout << "Hola5" << endl;
}
//____________________________________________________________________________
#include "AliPHOSGeometry.h"
#include "AliPHOSReconstructioner.h"
#include "AliPHOSTrackSegmentMaker.h"
+#include "AliPHOSParticleGuesser.h"
class AliPHOSv0 : public AliPHOS {
AliPHOSv0(void) ;
AliPHOSv0(const char *name, const char *title="") ;
- AliPHOSv0(AliPHOSReconstructioner& Reconstructioner, const char *name, const char *title="") ;
+ AliPHOSv0(AliPHOSReconstructioner * Reconstructioner, const char *name, const char *title="") ;
virtual ~AliPHOSv0(void) ;
virtual void AddHit( Int_t track, Int_t id, Float_t *hits ) ; // adds a pre-digitilized hit to the hit tree
virtual void Init(void) ; // does nothing
Int_t IsVersion(void) const { return 0 ; }
void MakeBranch(Option_t* opt) ;
- RecPointsList* PpsdClusters() {return fPpsdClusters;} // gets TClonesArray of clusters in the PPSD
- void Reconstruction(AliPHOSReconstructioner& Reconstructioner) ;
+ RecPointsList* PpsdClusters() { return fPpsdClusters ; } // gets TClonesArray of clusters in the PPSD
+ void Reconstruction(AliPHOSReconstructioner * Reconstructioner) ;
+ RecParticlesList * RecParticles() { return fRecParticles ; } // gets TClonesArray of reconstructed particles
void ResetClusters(){} ;
void SetReconstructioner(AliPHOSReconstructioner& Reconstructioner) {fReconstructioner = &Reconstructioner ;}
virtual void StepManager(void) ; // does the tracking through PHOS and a preliminary digitalization
- TObjArray * TrackSegments(){return fTrackSegments ;}
+ TrackSegmentsList * TrackSegments(){return fTrackSegments ;}
private:
AliPHOSReconstructioner * fReconstructioner ; // Reconstrutioner of the PHOS event: Clusterization and subtracking procedures
TClonesArray * fTmpHits ; //! idem
AliPHOSTrackSegmentMaker * fTrackSegmentMaker ;
- TObjArray * fTrackSegments ; //!
+ TrackSegmentsList * fTrackSegments ; //! idem
+ RecParticlesList * fRecParticles ; //! idem
public:
AliPHOSRecPoint.cxx AliPHOSEmcRecPoint.cxx AliPHOSPpsdRecPoint.cxx \
AliPHOSClusterizer.cxx AliPHOSClusterizerv1.cxx AliPHOSLink.cxx \
AliPHOSReconstructioner.cxx AliPHOSTrackSegment.cxx \
- AliPHOSTrackSegmentMaker.cxx AliPHOSTrackSegmentMakerv1.cxx ReconstructionTest.cxx PHOSHistos.cxx
+ AliPHOSTrackSegmentMaker.cxx AliPHOSTrackSegmentMakerv1.cxx \
+ AliPHOSRecParticle.cxx AliPHOSParticleGuesser.cxx AliPHOSParticleGuesserv1.cxx \
+ AliPHOSAnalyze.cxx PHOSHistos.cxx
# C++ Headers
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
//_________________________________________________________________________
// Cheking PHOSHistos procedure of PHOS
//*-- Author : Gines MARTINEZ SUBATECH january 2000
//////////////////////////////////////////////////////////////////////////////
// --- ROOT system ---
-
#include "TCanvas.h"
#include "TFile.h"
#include "TH1.h"
#include "AliPHOSReconstructioner.h"
#include "AliPHOSTrackSegment.h"
#include "AliPHOSTrackSegmentMakerv1.h"
+#include "AliPHOSParticleGuesserv1.h"
#include "PHOSHistos.h"
TFile * file = new TFile(infile);
//========== Get AliRun object from file
gAlice = (AliRun*) file->Get("gAlice");//=========== Gets the PHOS object and associated geometry from the file
+
AliPHOSv0 * PHOS = (AliPHOSv0 *)gAlice->GetDetector("PHOS");
AliPHOSGeometry * Geom = AliPHOSGeometry::GetInstance(PHOS->GetGeometry()->GetName(),PHOS->GetGeometry()->GetTitle());
-//========== Creates the Clusterizer
- AliPHOSClusterizerv1 clusterizer;
- clusterizer.SetEmcEnergyThreshold(0.01) ;
- clusterizer.SetEmcClusteringThreshold(0.1) ;
- clusterizer.SetPpsdEnergyThreshold(0.00000005) ;
- clusterizer.SetPpsdClusteringThreshold(0.0000005) ;
- clusterizer.SetLocalMaxCut(0.03) ;
- clusterizer.SetCalibrationParameters(0., 0.00000001) ;
//========== Creates the track segment maker
- AliPHOSTrackSegmentMakerv1 tracksegmentmaker ;
-//========== Creates the Reconstructioner
- AliPHOSReconstructioner Reconstructioner(clusterizer,tracksegmentmaker);
+ AliPHOSTrackSegmentMakerv1 * tracksegmentmaker = new AliPHOSTrackSegmentMakerv1() ;
+ //========== Creates the particle guesser
+ AliPHOSParticleGuesserv1 * particleguesser = new AliPHOSParticleGuesserv1 ;
+ cout << "AnalyzeOneEvent > using particle guess " << particleguesser->GetName() << endl ;
- TH1F * hEmcDigit = new TH1F("hEmcDigit","hEmcDigit",1000,0.,10.);
+ TH1F * hEmcDigit = new TH1F("hEmcDigit","hEmcDigit",1000,0.,5.);
TH1F * hVetoDigit = new TH1F("hVetoDigit","hVetoDigit",1000,0.,3.e-5);
TH1F * hConvertorDigit = new TH1F("hConvertorDigit","hConvertorDigit",1000,0.,3.e-5);
- TH1F * hEmcCluster = new TH1F("hEmcCluster","hEmcCluster",100,0.,10.);
+ TH1F * hEmcCluster = new TH1F("hEmcCluster","hEmcCluster",1000,-5.,5.);
TH1F * hVetoCluster = new TH1F("hVetoCluster","hVetoCluster",1000,0.,3.e-5);
TH1F * hConvertorCluster = new TH1F("hConvertorCluster","hConvertorCluster",1000,0.,3.e-5);
+ TH2F * hConvertorEmc = new TH2F("hConvertorEmc","hConvertorEmc",100,2.,3., 100, 0., 1.e-5);
+
AliPHOSDigit * digit ;
//========== Loop on events
Int_t ievent;
for(ievent=0;ievent<nevent; ievent++)
- {
- // cout << "Event " << ievent <<endl;
+ {
+//========== Creates the Clusterizer
+ AliPHOSClusterizerv1 * clusterizer = new AliPHOSClusterizerv1() ;
+ clusterizer->SetEmcEnergyThreshold(0.01) ;
+ clusterizer->SetEmcClusteringThreshold(0.1) ;
+ clusterizer->SetPpsdEnergyThreshold(0.00000005) ;
+ clusterizer->SetPpsdClusteringThreshold(0.00000005) ;
+ clusterizer->SetLocalMaxCut(0.03) ;
+ clusterizer->SetCalibrationParameters(0., 0.00000001) ;
+
+ //========== Creates the Reconstructioner
+ AliPHOSReconstructioner * Reconstructioner = new AliPHOSReconstructioner(clusterizer, tracksegmentmaker, particleguesser) ;
+
+ cout << "Event " << ievent <<endl;
Int_t RelId[4] ;
//=========== Connects the various Tree's for evt
Float_t Etot=0 ;
Int_t nVeto=0 ;
Int_t nConvertor=0 ;
+
while( ( digit = (AliPHOSDigit *)next() ) )
{
- Etot+=clusterizer.Calibrate(digit->GetAmp()) ;
+ Etot+=clusterizer->Calibrate(digit->GetAmp()) ;
Geom->AbsToRelNumbering(digit->GetId(), RelId) ;
- if (clusterizer.IsInEmc(digit))
- { hEmcDigit->Fill(clusterizer.Calibrate(digit->GetAmp())) ; }
+ if (clusterizer->IsInEmc(digit))
+ { hEmcDigit->Fill(clusterizer->Calibrate(digit->GetAmp())) ; }
else
{
- if (RelId[1]==9) {nVeto++; hVetoDigit->Fill(clusterizer.Calibrate(digit->GetAmp()));}
- if (RelId[1]==25){nConvertor++; hConvertorDigit->Fill(clusterizer.Calibrate(digit->GetAmp()));}
+ if (RelId[1]==9) {nVeto++; hVetoDigit->Fill(clusterizer->Calibrate(digit->GetAmp()));}
+ if (RelId[1]==25) {nConvertor++; hConvertorDigit->Fill(clusterizer->Calibrate(digit->GetAmp()));}
}
}
-
- // if (nVeto>1) printf("AnaPHOSv0.C> Number of Veto entries is %d \n",nVeto);
- // if (nConvertor>1) printf("AnaPHOSv0.C> Number of Convertor entries is %d \n",nConvertor);
-
-// cout <<"TestRec> Found " << nId << " digits in PHOS with total energy " << Etot << endl ;
-//
- PHOS->Reconstruction(Reconstructioner);
- // PHOS->EmcClusters()->Delete();
-// PHOS->PpsdClusters()->Delete();
-//
-// //=========== Cluster in Module
-// TClonesArray * EmcRP = PHOS->EmcClusters() ;
-// Etot = 0.;
-// Int_t TotalNumberOfClusters = 0 ;
-// Int_t NumberOfClusters = 0 ;
-// TIter nextemc(EmcRP) ;
-// AliPHOSEmcRecPoint * emc ;
-// while((emc = (AliPHOSEmcRecPoint *)nextemc()))
-// {
-// TotalNumberOfClusters++ ;
-// if ( emc->GetPHOSMod() == Module )
-// {
-// NumberOfClusters++ ;
-// Energy = emc->GetTotalEnergy() ;
-// hEmcCluster->Fill(Energy);
-// Etot+=Energy ;
-// }
-// }
-// cout << "TestRec> Found " << TotalNumberOfClusters << " EMC Clusters in PHOS" << endl ;
-// cout << "TestRec> Found in Module " << Module << " " << NumberOfClusters << " EMC Clusters " << endl ;
-// cout << "TestRec> Total energy " <<Etot << endl ;
-//
-// //=========== Cluster in Module PPSD Down
-// TClonesArray * PpsdRP = PHOS->PpsdClusters() ;
-// Etot = 0.;
-// Int_t TotalNumberOfClusters = 0 ;
-// Int_t NumberOfClusters = 0 ;
-// TIter nextPpsd(PpsdRP) ;
-// AliPHOSPpsdRecPoint * Ppsd ;
-// while((Ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
-// {
-// TotalNumberOfClusters++ ;
-// if ( Ppsd->GetPHOSMod() == Module )
-// {
-// NumberOfClusters++ ;
-// Energy = Ppsd->GetEnergy() ;
-// hConvertorCluster->Fill(Energy) ;
-// Etot+=Energy ;
-// if (!Ppsd->GetUp()) Ppsd->Draw("P") ;
-// }
-// }
-// cout << "TestRec> Found " << TotalNumberOfClusters << " Ppsd Down Clusters in PHOS" << endl ;
-// cout << "TestRec> Found in Module " << Module << " " << NumberOfClusters << " Ppsd Down Clusters " << endl ;
-// cout << "TestRec> Total energy " <<Etot << endl ;
-//
-// //=========== Cluster in Module PPSD Up
-// PpsdRP = PHOS->PpsdClusters() ;
-// Etot = 0.;
-// Int_t TotalNumberOfClusters = 0 ;
-// Int_t NumberOfClusters = 0 ;
-// TIter nextPpsdUp(PpsdRP) ;
-// while((Ppsd = (AliPHOSPpsdRecPoint *)nextPpsdUp()))
-// {
-// TotalNumberOfClusters++ ;
-// if ( Ppsd->GetPHOSMod() == Module )
-// {
-// NumberOfClusters++ ;
-// Energy = Ppsd->GetEnergy() ;
-// hVetoCluster->Fill(Energy);
-// Etot+=Energy ;
-// if (Ppsd->GetUp()) Ppsd->Draw("P") ;
-// }
-// }
-// cout << "TestRec> Found " << TotalNumberOfClusters << " Ppsd Up Clusters in PHOS" << endl ;
-// cout << "TestRec> Found in Module " << Module << " " << NumberOfClusters << " Ppsd Up Clusters " << endl ;
-// cout << "TestRec> Total energy " <<Etot << endl ;
-
+
+ PHOS->Reconstruction(Reconstructioner);
+
+//=========== Cluster in Module
+ TClonesArray * EmcRP = PHOS->EmcClusters() ;
+ TIter nextemc(EmcRP) ;
+ AliPHOSEmcRecPoint * emc ;
+ Float_t Energy;
+ while((emc = (AliPHOSEmcRecPoint *)nextemc()))
+ {
+ if ( emc->GetPHOSMod() == Module )
+ {
+ Energy = emc->GetTotalEnergy() ;
+ hEmcCluster->Fill(Energy);
+ printf("Energy of the EMC cluster is %f \n",Energy);
+ TClonesArray * PpsdRP = PHOS->PpsdClusters() ;
+ TIter nextPpsd(PpsdRP) ;
+ AliPHOSPpsdRecPoint * Ppsd ;
+ Float_t Energy2;
+ while((Ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
+ {
+ if ( Ppsd->GetPHOSMod() == Module )
+ {
+ Energy2 = Ppsd->GetTotalEnergy() ;
+
+ if (!Ppsd->GetUp()) hConvertorEmc->Fill(Energy,Energy2) ;
+ }
+ }
+
+ }
+ }
+
+ //=========== Cluster in Module PPSD Down
+ TClonesArray * PpsdRP = PHOS->PpsdClusters() ;
+ TIter nextPpsd(PpsdRP) ;
+ AliPHOSPpsdRecPoint * Ppsd ;
+ while((Ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
+ {
+ if ( Ppsd->GetPHOSMod() == Module )
+ {
+ Energy = Ppsd->GetTotalEnergy() ;
+
+ if (!Ppsd->GetUp()) hConvertorCluster->Fill(Energy) ;
+ if (Ppsd->GetUp()) hVetoCluster->Fill(Energy) ;
+
+ }
+ }
}
+
TCanvas * cVetoDigit = new TCanvas("VetoDigit","VetoDigit");
hVetoDigit->Draw();
TCanvas * cConvertorDigit = new TCanvas("ConvertorDigit","ConvertorDigit");
hConvertorDigit->Draw();
TCanvas * cEmcDigit = new TCanvas("EmcDigit","EmcDigit");
hEmcDigit->Draw();
-
-
+ TCanvas * cVetoCluster = new TCanvas("VetoCluster","VetoCluster");
+ hVetoCluster->Draw();
+ TCanvas * cConvertorCluster = new TCanvas("ConvertorCluster","ConvertorCluster");
+ hConvertorCluster->Draw();
+ TCanvas * cEmcCluster = new TCanvas("EmcCluster","EmcCluster");
+ hEmcCluster->Draw();
+ TCanvas * cConvertorEmc = new TCanvas("ConvertorEmc","ConvertorEmc");
+ hConvertorEmc->Draw("col1");
+
+
}
#pragma link C++ class AliPHOSTrackSegment ;
#pragma link C++ class AliPHOSTrackSegmentMaker ;
#pragma link C++ class AliPHOSTrackSegmentMakerv1 ;
-#pragma link C++ function ReconstructionTest(Text_t*,Int_t, Int_t);
+#pragma link C++ class AliPHOSRecParticle ;
+#pragma link C++ class AliPHOSParticleGuesser ;
+#pragma link C++ class AliPHOSParticleGuesserv1 ;
+#pragma link C++ class AliPHOSAnalyze ;
#pragma link C++ function PHOSHistos(Text_t*,Int_t, Int_t);
#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. *
- **************************************************************************/
-
-//_________________________________________________________________________
-// Cheking Reconstruction procedure of PHOS
-//*-- Author : Gines MARTINEZ SUBATECH january 2000
-//////////////////////////////////////////////////////////////////////////////
-
-// --- ROOT system ---
-
-#include "TFile.h"
-#include "TH1.h"
-#include "TPad.h"
-#include "TTree.h"
-#include "TCanvas.h"
-#include "TParticle.h"
-
-// --- Standard library ---
-
-#include <iostream>
-#include <cstdio>
-
-
-// --- AliRoot header files ---
-#include "AliRun.h"
-#include "TFile.h"
-#include "AliPHOSGeometry.h"
-#include "AliPHOSv0.h"
-#include "AliPHOSDigit.h"
-#include "AliPHOSRecPoint.h"
-#include "AliPHOSEmcRecPoint.h"
-#include "AliPHOSPpsdRecPoint.h"
-#include "AliPHOSClusterizerv1.h"
-#include "AliPHOSReconstructioner.h"
-#include "AliPHOSTrackSegment.h"
-#include "AliPHOSTrackSegmentMakerv1.h"
-#include "ReconstructionTest.h"
-
-
-void ReconstructionTest(Text_t* infile,Int_t evt, Int_t Module)
-{
- //========== Opening galice.root file
- TFile * file = new TFile(infile);
- //========== Get AliRun object from file
- gAlice = (AliRun*) file->Get("gAlice");
- //=========== Gets the PHOS object and associated geometry from the file
- AliPHOSv0 * PHOS = (AliPHOSv0 *)gAlice->GetDetector("PHOS");
- AliPHOSGeometry * Geom = AliPHOSGeometry::GetInstance(PHOS->GetGeometry()->GetName(),PHOS->GetGeometry()->GetTitle());
- //========== Creates the Clusterizer
- AliPHOSClusterizerv1 clusterizer;
- clusterizer.SetEmcEnergyThreshold(0.01) ;
- clusterizer.SetEmcClusteringThreshold(0.1) ;
- clusterizer.SetPpsdEnergyThreshold(0.0000001) ;
- clusterizer.SetPpsdClusteringThreshold(0.0000002) ;
- clusterizer.SetLocalMaxCut(0.03) ;
- clusterizer.SetCalibrationParameters(0., 0.0000001) ;
- //========== Creates the track segment maker
- AliPHOSTrackSegmentMakerv1 tracksegmentmaker ;
- //========== Creates the Reconstructioner
- AliPHOSReconstructioner Reconstructioner(clusterizer,tracksegmentmaker);
- //=========== Connects the various Tree's for evt
- gAlice->GetEvent(evt);
- //=========== Gets the Digit TTree
- gAlice->TreeD()->GetEvent(0) ;
- //=========== Gets the number of entries in the Digits array
- Int_t nId = PHOS->Digits()->GetEntries();
- printf("ReconstructionTest> Number of entries in the Digit array is %d \n",nId);
- //=========== Do the reconstruction
- AliPHOSDigit * digit ;
- TIter next(PHOS->Digits()) ;
- Float_t Etot=0 ;
- while( ( digit = (AliPHOSDigit *)next() ) )
- Etot+=clusterizer.Calibrate(digit->GetAmp()) ;
- cout <<"ReconstructionTest> Found " << nId << " digits in PHOS with total energy " << Etot << endl ;
- PHOS->Reconstruction(Reconstructioner);
- //================Make checks===========================
-
- //=========== Creating Canvas
- TCanvas * ModuleCanvas = new TCanvas("Module","Events in a single PHOS Module", 650, 500) ;
- ModuleCanvas->Draw() ;
-
- //=========== Creating 2d-histogram of the PHOS Module
- // a little bit junkie but is used to test Geom functinalities
-
- Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by Module 1
-
- Geom->EmcModuleCoverage(1, tm, tM, pm, pM);
- // convert angles into coordinates local to the EMC module of interest
-
- Int_t EmcModuleNumber ;
- Double_t EmcModulexm, EmcModulezm ; // minimum local coordinate in a given EMCA module
- Double_t EmcModulexM, EmcModulezM ; // maximum local coordinate in a given EMCA module
- Geom->ImpactOnEmc(tm, pm, EmcModuleNumber, EmcModulezm, EmcModulexm) ;
- Geom->ImpactOnEmc(tM, pM, EmcModuleNumber, EmcModulezM, EmcModulexM) ;
- Int_t xdim = (Int_t)( ( EmcModulexM - EmcModulexm ) / Geom->GetCrystalSize(0) ) ;
- Int_t zdim = (Int_t)( ( EmcModulezM - EmcModulezm ) / Geom->GetCrystalSize(2) ) ;
- Float_t xmin = EmcModulexm - Geom->GetCrystalSize(0) ;
- Float_t xMax = EmcModulexM + Geom->GetCrystalSize(0) ;
- Float_t zmin = EmcModulezm - Geom->GetCrystalSize(2) ;
- Float_t zMax = EmcModulezM + Geom->GetCrystalSize(2) ;
- // histogram of reconstructed events
- Text_t HistoName[80];
- sprintf(HistoName,"Event %d: Reconstructed particles in module %d", evt, Module) ;
- TH2F * hModule = new TH2F("HistoReconstructed", HistoName,
- xdim, xmin, xMax, zdim, zmin, zMax) ;
- hModule->SetMaximum(2.0);
- hModule->SetMinimum(0.0);
- hModule->SetStats(kFALSE);
- // histogram of generated particles
- sprintf(HistoName,"Event %d: Incident particles in module %d", evt, Module) ;
- TH2F * HistoParticle = new TH2F("HistoParticle", HistoName,
- xdim, xmin, xMax, zdim, zmin, zMax) ;
- HistoParticle->SetStats(kFALSE) ;
-
- //=========== Digits of Module
- TIter next2(PHOS->Digits()) ;
- Float_t Energy, y, z;
- Int_t RelId[4]; Int_t NumberOfDigits = 0 ;
- while((digit = (AliPHOSDigit *)next2()))
- {
- Geom->AbsToRelNumbering(digit->GetId(), RelId) ;
- if (RelId[0] == Module)
- {
- NumberOfDigits++ ;
- Energy = clusterizer.Calibrate(digit->GetAmp()) ;
- Etot+=Energy ;
- Geom->RelPosInModule(RelId,y,z) ;
- if (Energy>0.01 )
- hModule->Fill(y,z,Energy) ;
- }
- }
- cout <<"TestRec> Found in Module " << Module << " " << NumberOfDigits << " digits with total energy " << Etot << endl ;
- hModule->Draw("col2") ;
-
- //=========== Cluster in Module
- TClonesArray * EmcRP = PHOS->EmcClusters() ;
- Etot = 0.;
- Int_t TotalNumberOfClusters = 0 ;
- Int_t NumberOfClusters = 0 ;
- TIter nextemc(EmcRP) ;
- AliPHOSEmcRecPoint * emc ;
- while((emc = (AliPHOSEmcRecPoint *)nextemc()))
- {
- TotalNumberOfClusters++ ;
- if ( emc->GetPHOSMod() == Module )
- {
- NumberOfClusters++ ;
- Energy = emc->GetTotalEnergy() ;
- Etot+=Energy ;
- emc->Draw("P") ;
- }
- }
- cout << "TestRec> Found " << TotalNumberOfClusters << " EMC Clusters in PHOS" << endl ;
- cout << "TestRec> Found in Module " << Module << " " << NumberOfClusters << " EMC Clusters " << endl ;
- cout << "TestRec> Total energy " <<Etot << endl ;
-
- TPaveText * PaveText = new TPaveText(22, 80, 83, 90);
- Text_t text[40] ;
- sprintf(text, "digits: %d; clusters: %d", NumberOfDigits, NumberOfClusters) ;
- PaveText->AddText(text) ;
- PaveText->Draw() ;
- ModuleCanvas->Update();
-
- //=========== Cluster in Module PPSD Down
- TClonesArray * PpsdRP = PHOS->PpsdClusters() ;
- Etot = 0.;
- TIter nextPpsd(PpsdRP) ;
- AliPHOSPpsdRecPoint * Ppsd ;
- while((Ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
- {
- TotalNumberOfClusters++ ;
- if ( Ppsd->GetPHOSMod() == Module )
- {
- NumberOfClusters++ ;
- Energy = Ppsd->GetEnergy() ;
- Etot+=Energy ;
- if (!Ppsd->GetUp()) Ppsd->Draw("P") ;
- }
- }
- cout << "TestRec> Found " << TotalNumberOfClusters << " Ppsd Down Clusters in PHOS" << endl ;
- cout << "TestRec> Found in Module " << Module << " " << NumberOfClusters << " Ppsd Down Clusters " << endl ;
- cout << "TestRec> Total energy " <<Etot << endl ;
-
-//=========== Cluster in Module PPSD Up
- PpsdRP = PHOS->PpsdClusters() ;
- Etot = 0.;
- TIter nextPpsdUp(PpsdRP) ;
- while((Ppsd = (AliPHOSPpsdRecPoint *)nextPpsdUp()))
- {
- TotalNumberOfClusters++ ;
- if ( Ppsd->GetPHOSMod() == Module )
- {
- NumberOfClusters++ ;
- Energy = Ppsd->GetEnergy() ;
- Etot+=Energy ;
- if (Ppsd->GetUp()) Ppsd->Draw("P") ;
- }
- }
- cout << "TestRec> Found " << TotalNumberOfClusters << " Ppsd Up Clusters in PHOS" << endl ;
- cout << "TestRec> Found in Module " << Module << " " << NumberOfClusters << " Ppsd Up Clusters " << endl ;
- cout << "TestRec> Total energy " <<Etot << endl ;
-
- // Get pointers to Alice Particle TClonesArray
- TParticle * Particle;
- TClonesArray * ArrayOfParticles = gAlice->Particles();
- TCanvas * KineCanvas = new TCanvas("KineCnvas", "Incident particles", 650, 500) ;
- // get the KINE Tree
- TTree * Kine = gAlice->TreeK() ;
- Stat_t NumberOfParticles = Kine->GetEntries() ;
- cout << "events in Kine " << NumberOfParticles << endl ;
-
- // loop over particles
- Int_t index1 ;
- Int_t nparticlein = 0 ;
- for (index1 = 0 ; index1 < NumberOfParticles ; index1++){
- Int_t nparticle = ArrayOfParticles->GetEntriesFast() ;
- cout << nparticle << endl ;
- Int_t index2 ;
- for( index2 = 0 ; index2 < nparticle; index2++) {
- Particle = (TParticle*)ArrayOfParticles->UncheckedAt(index2) ;
- Int_t ParticleType = Particle->GetPdgCode() ;
- Double_t Phi = Particle->Phi() ;
- Double_t Theta = Particle->Theta() ;
- Int_t mod ;
- Double_t x, z ;
- Geom->ImpactOnEmc(Theta, Phi, mod, z, x) ;
- if ( mod == Module ) {
- nparticlein++ ;
- HistoParticle->Fill( x, -z, Particle->Energy() ) ; //-z don't know why, but that is how it works
- }
- }
- }
- KineCanvas->Draw() ;
- HistoParticle->Draw("color") ;
- TPaveText * PaveText2 = new TPaveText(22, 80, 83, 90);
- sprintf(text, "Particles: %d ", nparticlein) ;
- PaveText2->AddText(text) ;
- PaveText2->Draw() ;
- KineCanvas->Update();
-
-// TObjArray * trsegl = PHOS->TrackSegments() ;
-// AliPHOSTrackSegment trseg ;
-
-// Int_t NTrackSegments = trsegl->GetEntries() ;
-// Int_t index ;
-// Etot = 0 ;
-// for(index = 0; index < NTrackSegments ; index++){
-// trseg = (AliPHOSTrackSegment * )trsegl->At(index) ;
-// Etot+= trseg->GetEnergy() ;
-// if ( trseg->GetPHOSMod() == Module )
-// {
-// // trseg->Draw("P");
-// trseg->Print() ;
-// }
-// }
-// cout << "Found " << trsegl->GetEntries() << " Track segments with total energy "<< Etot << endl ;
-//
-
-
-
-}
-
-
+++ /dev/null
-#ifndef RECONSTRUCTIONTEST_H
-#define RECONSTRUCTIONTEST_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-////////////////////////////////////////////////
-// ReconstructionTest function for PHOS //
-// Version SUBATECH //
-// Author G.Martinez, SUBATECH //
-// january 2000: //
-////////////////////////////////////////////////
-
-// --- ROOT system ---
-
-// --- AliRoot header files ---
-
-// --- Standard library ---
-
-
-void ReconstructionTest(Text_t *,Int_t evt, Int_t Module) ;
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif // RECONSTRUCTIONTEST_H
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
//_________________________________________________________________________
// Short description
//*-- Author : SUBATECH
ClassImp(AliPHOSxxx)
-//____________________________________________________________________________
-void AliPHOSxxx::AliPHOSxxx()
+//____________________________________________________________________________
+AliPHOSxxx::AliPHOSxxx()
{
// ctor
}
//____________________________________________________________________________
-void ~AliPHOSxxx::AliPHOSxxx()
+AliPHOSxxx::~AliPHOSxxx()
{
// dtor
}
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/* $Id$ */
+
////////////////////////////////////////////////
// Short description //
// Author SUBATECH //
class AliPHOSxxx {
public:
+ AliPHOSxxx() ; // ctor
virtual ~AliPHOSxxx() ; // dtor
private:
+public:
+
ClassDef(AliPHOSxxx,1) // description , version 1
};