From b2a609669e35c09c3298f41c1cf13e86bdcbb39d Mon Sep 17 00:00:00 2001 From: schutz Date: Mon, 13 Mar 2000 09:15:45 +0000 Subject: [PATCH] Improve documentation --- PHOS/AliPHOS.cxx | 27 +-- PHOS/AliPHOS.h | 23 +- PHOS/AliPHOSAnalyze.cxx | 82 ++++++- PHOS/AliPHOSAnalyze.h | 63 +++-- PHOS/AliPHOSClusterizer.cxx | 7 +- PHOS/AliPHOSClusterizer.h | 17 +- PHOS/AliPHOSClusterizerv1.cxx | 35 ++- PHOS/AliPHOSClusterizerv1.h | 34 ++- PHOS/AliPHOSDigit.cxx | 44 +++- PHOS/AliPHOSDigit.h | 20 +- PHOS/AliPHOSEmcRecPoint.cxx | 135 ++++++----- PHOS/AliPHOSEmcRecPoint.h | 21 +- PHOS/AliPHOSFastRecParticle.cxx | 66 ++++-- PHOS/AliPHOSFastRecParticle.h | 25 +- PHOS/AliPHOSGeometry.cxx | 52 +++-- PHOS/AliPHOSGeometry.h | 23 +- PHOS/AliPHOSHit.cxx | 20 +- PHOS/AliPHOSHit.h | 22 +- PHOS/AliPHOSLink.cxx | 12 +- PHOS/AliPHOSLink.h | 15 +- PHOS/AliPHOSPID.cxx | 11 +- PHOS/AliPHOSPID.h | 16 +- PHOS/AliPHOSPIDv1.cxx | 32 +-- PHOS/AliPHOSPIDv1.h | 28 ++- PHOS/AliPHOSPpsdRecPoint.cxx | 108 ++++----- PHOS/AliPHOSPpsdRecPoint.h | 25 +- PHOS/AliPHOSRecParticle.cxx | 58 ++++- PHOS/AliPHOSRecParticle.h | 15 +- PHOS/AliPHOSRecPoint.cxx | 221 +++++++++--------- PHOS/AliPHOSRecPoint.h | 21 +- PHOS/AliPHOSReconstructioner.cxx | 36 ++- PHOS/AliPHOSReconstructioner.h | 22 +- PHOS/AliPHOSTrackSegment.cxx | 343 +++++++++++++++++----------- PHOS/AliPHOSTrackSegment.h | 35 +-- PHOS/AliPHOSTrackSegmentMaker.cxx | 15 +- PHOS/AliPHOSTrackSegmentMaker.h | 23 +- PHOS/AliPHOSTrackSegmentMakerv1.cxx | 71 +++--- PHOS/AliPHOSTrackSegmentMakerv1.h | 23 +- PHOS/AliPHOSv0.cxx | 186 ++++++++++++--- PHOS/AliPHOSv0.h | 34 ++- PHOS/AliPHOSv1.cxx | 83 ++++--- PHOS/AliPHOSv1.h | 51 ++--- PHOS/AliPHOSvFast.cxx | 89 ++++++-- PHOS/AliPHOSvFast.h | 19 +- PHOS/Makefile | 5 +- PHOS/PHOS-HTML/fastsimulation.html | 24 +- PHOS/PHOS-HTML/geometry.html | 53 +++-- PHOS/PHOS-HTML/index.html | 8 +- PHOS/PHOSLinkDef.h | 1 + PHOS/canevas.cxx | 18 +- PHOS/canevas.h | 13 +- 51 files changed, 1429 insertions(+), 1001 deletions(-) diff --git a/PHOS/AliPHOS.cxx b/PHOS/AliPHOS.cxx index 555f66a2548..49da2c3a44b 100644 --- a/PHOS/AliPHOS.cxx +++ b/PHOS/AliPHOS.cxx @@ -13,10 +13,16 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Base Class of PHOS. -// Only creates the materials -//*-- Author : Laurent Aphecetche SUBATECH +// Base Class for PHOS description: +// PHOS consists of a PbWO4 calorimeter (EMCA) and a gazeous charged +// particles detector (CPV or PPSD). +// The only provided method here is CreateMaterials, +// which defines the materials common to all PHOS versions. +// +//*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH) ////////////////////////////////////////////////////////////////////////////// // --- ROOT system --- @@ -27,22 +33,10 @@ #include "AliPHOS.h" #include "AliMC.h" -//#include "TGeant3.h" #include "AliRun.h" ClassImp(AliPHOS) -//____________________________________________________________________________ -AliPHOS::AliPHOS(const char* name, const char* title) - : AliDetector(name,title) -{ -} - -//____________________________________________________________________________ -AliPHOS::AliPHOS() : AliDetector() -{ -} - //____________________________________________________________________________ AliPHOS::~AliPHOS() { @@ -53,7 +47,8 @@ AliPHOS::~AliPHOS() //____________________________________________________________________________ void AliPHOS::CreateMaterials() { - // DEFINITION OF PHOS MATERIALS + // Definitions of materials to build PHOS and associated tracking media. + // media number in idtmed are 699 to 798. // --- The PbWO4 crystals --- Float_t aX[3] = {207.19, 183.85, 16.0} ; diff --git a/PHOS/AliPHOS.h b/PHOS/AliPHOS.h index 17a3b750082..eed560c7592 100644 --- a/PHOS/AliPHOS.h +++ b/PHOS/AliPHOS.h @@ -5,15 +5,10 @@ /* $Id$ */ -//////////////////////////////////////////////// -// Abstract Base Class for PHOS // -// Version SUBATECH // -// Author Laurent Aphecetche SUBATECH // -// The only provided method here is // -// CreateMaterials, which defines the // -// materials common to all PHOS versions. // -// // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// Base Class for PHOS +// +//*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH) // --- ROOT system --- @@ -27,14 +22,14 @@ class AliPHOS : public AliDetector { public: - AliPHOS(const char* name, const char* title) ; - AliPHOS() ; + AliPHOS(const char* name, const char* title): AliDetector(name,title) {} + AliPHOS() : AliDetector() {} virtual ~AliPHOS() ; - virtual void CreateMaterials() ; - virtual AliPHOSGeometry * GetGeometry() = 0 ; + virtual void CreateMaterials() ; // defines the material of the detector + virtual AliPHOSGeometry * GetGeometry() = 0 ; // hands the pointer to the unique geometry object - ClassDef(AliPHOS,2) // Photon Spectrometer Detector + ClassDef(AliPHOS,2) // Photon Spectrometer Detector (base class) } ; diff --git a/PHOS/AliPHOSAnalyze.cxx b/PHOS/AliPHOSAnalyze.cxx index 64a91900678..44ae189b2d3 100644 --- a/PHOS/AliPHOSAnalyze.cxx +++ b/PHOS/AliPHOSAnalyze.cxx @@ -13,9 +13,14 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Algorythm class to analyze PHOS events -//*-- Y. Schutz : SUBATECH +// Algorythm class to analyze PHOSv0 events: +// Construct histograms and displays them. +// Use the macro EditorBar.C for best access to the functionnalities +// +//*-- Author: Y. Schutz (SUBATECH) ////////////////////////////////////////////////////////////////////////////// // --- ROOT system --- @@ -53,7 +58,7 @@ ClassImp(AliPHOSAnalyze) //____________________________________________________________________________ AliPHOSAnalyze::AliPHOSAnalyze() { - // ctor + // default ctor (useless) fRootFile = 0 ; } @@ -61,7 +66,7 @@ ClassImp(AliPHOSAnalyze) //____________________________________________________________________________ AliPHOSAnalyze::AliPHOSAnalyze(Text_t * name) { - // ctor + // ctor: analyze events from root file: name Bool_t ok = OpenRootFile(name) ; if ( !ok ) { @@ -104,6 +109,10 @@ AliPHOSAnalyze::~AliPHOSAnalyze() //____________________________________________________________________________ void AliPHOSAnalyze::AnalyzeOneEvent(Int_t evt) { + // analyze one single event with id=evt + + TStopwatch ts ; + ts.Start() ; Bool_t ok = Init(evt) ; if ( ok ) { @@ -120,17 +129,26 @@ void AliPHOSAnalyze::AnalyzeOneEvent(Int_t evt) fPHOS->Reconstruction(fRec); // =========== End of reconstruction + + // =========== Write the root file + + fRootFile->Write() ; + // =========== Finish + cout << "AnalyzeOneEvent > event # " << fEvt << " processed" << endl ; } // ok else cout << "AnalyzeOneEvent > filed to process event # " << evt << endl ; - + + ts.Stop() ; cout << "CPU time = " << ts.CpuTime() << endl ; + cout << "Real time = " << ts.RealTime() << endl ; } //____________________________________________________________________________ - void AliPHOSAnalyze::AnalyzeManyEvents(Int_t Nevents, Int_t module) // analyzes many events + void AliPHOSAnalyze::AnalyzeManyEvents(Int_t Nevents, Int_t module) { + // analyzes Nevents events in a single PHOS module if ( fRootFile == 0 ) cout << "AnalyzeManyEvents > " << "Root File not openned" << endl ; @@ -224,7 +242,13 @@ void AliPHOSAnalyze::AnalyzeOneEvent(Int_t evt) { if ( recparticle->GetPHOSTrackSegment()->GetPHOSMod() == module ) { - cout << "Particle type is " << recparticle->GetType() << endl ; + cout << "Particle type is " << recparticle->GetType() << endl ; + Int_t numberofprimaries = 0 ; + Int_t * listofprimaries = recparticle->GetPrimaries(numberofprimaries) ; + cout << "Number of primaries = " << numberofprimaries << endl ; + Int_t index ; + for ( index = 0 ; index < numberofprimaries ; index++) + cout << " primary # " << index << " = " << listofprimaries[index] << endl ; switch(recparticle->GetType()) { case kGAMMA: @@ -281,6 +305,8 @@ void AliPHOSAnalyze::AnalyzeOneEvent(Int_t evt) //____________________________________________________________________________ void AliPHOSAnalyze::BookingHistograms() { + // Books the histograms where the results of the analysis are stored (to be changed) + if (fhEmcDigit ) delete fhEmcDigit ; if (fhVetoDigit ) @@ -327,6 +353,10 @@ void AliPHOSAnalyze::BookingHistograms() //____________________________________________________________________________ Bool_t AliPHOSAnalyze::Init(Int_t evt) { + // Do a few initializations: open the root file + // get the AliRun object + // defines the clusterizer, tracksegment maker and particle identifier + // sets the associated parameters Bool_t ok = kTRUE ; @@ -357,7 +387,7 @@ Bool_t AliPHOSAnalyze::Init(Int_t evt) fClu = new AliPHOSClusterizerv1() ; fClu->SetEmcEnergyThreshold(0.030) ; - fClu->SetEmcClusteringThreshold(0.50) ; + fClu->SetEmcClusteringThreshold(1.0) ; fClu->SetPpsdEnergyThreshold (0.0000002) ; fClu->SetPpsdClusteringThreshold(0.0000001) ; fClu->SetLocalMaxCut(0.03) ; @@ -403,6 +433,10 @@ Bool_t AliPHOSAnalyze::Init(Int_t evt) //____________________________________________________________________________ void AliPHOSAnalyze::DisplayKineEvent(Int_t evt) { + // Display particles from the Kine Tree in global Alice (theta, phi) coordinates. + // One PHOS module at the time. + // The particle type can be selected. + if (evt == -999) evt = fEvt ; @@ -473,7 +507,8 @@ void AliPHOSAnalyze::DisplayKineEvent(Int_t evt) fGeom->ImpactOnEmc(theta, phi, mod, z, x) ; if ( mod == module ) { nparticlein++ ; - histoparticle->Fill(phi*kRADDEG, theta*kRADDEG, particle->Energy() ) ; + if (particle->Energy() > fClu->GetEmcClusteringThreshold() ) + histoparticle->Fill(phi*kRADDEG, theta*kRADDEG, particle->Energy() ) ; } } } @@ -491,6 +526,10 @@ void AliPHOSAnalyze::DisplayKineEvent(Int_t evt) //____________________________________________________________________________ void AliPHOSAnalyze::DisplayRecParticles() { + // Display reconstructed particles in global Alice(theta, phi) coordinates. + // One PHOS module at the time. + // Click on symbols indicate the reconstructed particle type. + if (fEvt == -999) { cout << "DisplayRecParticles > Analyze an event first ... (y/n) " ; Text_t answer[1] ; @@ -529,7 +568,14 @@ void AliPHOSAnalyze::DisplayRecParticles() Double_t kRADDEG = 180. / TMath::Pi() ; while ( (rp = (AliPHOSRecParticle *)nextRecPart() ) ) { AliPHOSTrackSegment * ts = rp->GetPHOSTrackSegment() ; - if ( ts->GetPHOSMod() == module ) { + if ( ts->GetPHOSMod() == module ) { + Int_t numberofprimaries = 0 ; + Int_t * listofprimaries = rp->GetPrimaries(numberofprimaries) ; + cout << "Number of primaries = " << numberofprimaries << endl ; + Int_t index ; + for ( index = 0 ; index < numberofprimaries ; index++) + cout << " primary # " << index << " = " << listofprimaries[index] << endl ; + nRecParticlesInModule++ ; Double_t theta = rp->Theta() * kRADDEG ; Double_t phi = rp->Phi() * kRADDEG ; @@ -558,6 +604,10 @@ void AliPHOSAnalyze::DisplayRecParticles() //____________________________________________________________________________ void AliPHOSAnalyze::DisplayRecPoints() { + // Display reconstructed points in local PHOS-module (x, z) coordinates. + // One PHOS module at the time. + // Click on symbols displays the EMC cluster, or PPSD information. + if (fEvt == -999) { cout << "DisplayRecPoints > Analyze an event first ... (y/n) " ; Text_t answer[1] ; @@ -709,6 +759,10 @@ void AliPHOSAnalyze::DisplayRecPoints() //____________________________________________________________________________ void AliPHOSAnalyze::DisplayTrackSegments() { + // Display track segments in local PHOS-module (x, z) coordinates. + // One PHOS module at the time. + // One symbol per PHOS subsystem: EMC, upper PPSD, lower PPSD. + if (fEvt == -999) { cout << "DisplayTrackSegments > Analyze an event first ... (y/n) " ; Text_t answer[1] ; @@ -778,13 +832,17 @@ void AliPHOSAnalyze::DisplayTrackSegments() //____________________________________________________________________________ Bool_t AliPHOSAnalyze::OpenRootFile(Text_t * name) { - fRootFile = new TFile(name) ; + // Open the root file named "name" + + fRootFile = new TFile(name, "update") ; return fRootFile->IsOpen() ; } //____________________________________________________________________________ void AliPHOSAnalyze::SavingHistograms() { - Text_t outputname[80] ;// = fRootFile->GetName(); + // Saves the histograms in a root file named "name.analyzed" + + Text_t outputname[80] ; sprintf(outputname,"%s.analyzed",fRootFile->GetName()); TFile output(outputname,"RECREATE"); output.cd(); diff --git a/PHOS/AliPHOSAnalyze.h b/PHOS/AliPHOSAnalyze.h index 35cc8e9603c..2d5b8aac62f 100644 --- a/PHOS/AliPHOSAnalyze.h +++ b/PHOS/AliPHOSAnalyze.h @@ -5,12 +5,9 @@ /* $Id$ */ -//////////////////////////////////////////////// -// Algorythm class to analyze PHOS events // -// Yves Schutz SUBATECH // -// // -// // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// Algorithm class to analyze PHOSv0 events +//*-- Author : Yves Schutz (SUBATECH) // --- ROOT system --- @@ -49,40 +46,40 @@ private: AliPHOSClusterizer * fClu ; // a clusterizer Int_t fEvt ; // the evt number being processed - AliPHOSGeometry * fGeom; // the PHOS Geometry object + AliPHOSGeometry * fGeom ; // the PHOS Geometry object AliPHOSv0 * fPHOS ; // the PHOS object from the root file AliPHOSPID * fPID ; // a particle identifier AliPHOSReconstructioner * fRec ; // a reconstructioner TFile * fRootFile ; // the root file that contains the data AliPHOSTrackSegmentMaker * fTrs ; // a tracksegmentmaker ; - TH1F * fhEmcDigit ; // Histo of digit energies in the Emc - TH1F * fhVetoDigit ; // Histo of digit energies in the Veto - TH1F * fhConvertorDigit ; // Histo of digit energies in the Convertor - TH1F * fhEmcCluster ; // Histo of Cluster energies in Emc - TH1F * fhVetoCluster ; // Histo of Cluster energies in Veto - TH1F * fhConvertorCluster; // Histo of Cluster energies in Convertor - TH2F * fhConvertorEmc ; // 2d Convertor versus Emc energies - TH1F * fhPhotonEnergy ; // Spectrum of detected photons - TH1F * fhElectronEnergy ; // Spectrum of detected electrons - TH1F * fhNeutralHadronEnergy ; // Spectrum of detected neutral hadron - TH1F * fhNeutralEMEnergy ; // Spectrum of detected neutral EM - TH1F * fhChargedHadronEnergy ; // Spectrum of detected charged - TH1F * fhPhotonHadronEnergy ; // Spectrum of detected Photon-Hadron - TH1F * fhPhotonPositionX ; // X distribution of detected photons - TH1F * fhElectronPositionX ; // X distribution of detected electrons - TH1F * fhNeutralHadronPositionX ; // X distribution of detected neutral hadron - TH1F * fhNeutralEMPositionX ; // X distribution of detected neutral EM - TH1F * fhChargedHadronPositionX ; // X distribution of detected charged - TH1F * fhPhotonHadronPositionX ; // X distribution of detected Photon-Hadron - TH1F * fhPhotonPositionY ; // Y distribution of detected photons - TH1F * fhElectronPositionY ; // Y distribution of detected electrons - TH1F * fhNeutralHadronPositionY ; // Y distribution of detected neutral hadron - TH1F * fhNeutralEMPositionY ; // Y distribution of detected neutral EM - TH1F * fhChargedHadronPositionY ; // Y distribution of detected charged - TH1F * fhPhotonHadronPositionY ; // Y distribution of detected Photon-Hadron + TH1F * fhEmcDigit ; // Histo of digit energies in the Emc + TH1F * fhVetoDigit ; // Histo of digit energies in the Veto + TH1F * fhConvertorDigit ; // Histo of digit energies in the Convertor + TH1F * fhEmcCluster ; // Histo of Cluster energies in Emc + TH1F * fhVetoCluster ; // Histo of Cluster energies in Veto + TH1F * fhConvertorCluster ; // Histo of Cluster energies in Convertor + TH2F * fhConvertorEmc ; // 2d Convertor versus Emc energies + TH1F * fhPhotonEnergy ; // Spectrum of detected photons + TH1F * fhElectronEnergy ; // Spectrum of detected electrons + TH1F * fhNeutralHadronEnergy ; // Spectrum of detected neutral hadron + TH1F * fhNeutralEMEnergy ; // Spectrum of detected neutral EM + TH1F * fhChargedHadronEnergy ; // Spectrum of detected charged + TH1F * fhPhotonHadronEnergy ; // Spectrum of detected Photon-Hadron + TH1F * fhPhotonPositionX ; // X distribution of detected photons + TH1F * fhElectronPositionX ; // X distribution of detected electrons + TH1F * fhNeutralHadronPositionX ; // X distribution of detected neutral hadron + TH1F * fhNeutralEMPositionX ; // X distribution of detected neutral EM + TH1F * fhChargedHadronPositionX ; // X distribution of detected charged + TH1F * fhPhotonHadronPositionX ; // X distribution of detected Photon-Hadron + TH1F * fhPhotonPositionY ; // Y distribution of detected photons + TH1F * fhElectronPositionY ; // Y distribution of detected electrons + TH1F * fhNeutralHadronPositionY ; // Y distribution of detected neutral hadron + TH1F * fhNeutralEMPositionY ; // Y distribution of detected neutral EM + TH1F * fhChargedHadronPositionY ; // Y distribution of detected charged + TH1F * fhPhotonHadronPositionY ; // Y distribution of detected Photon-Hadron -ClassDef(AliPHOSAnalyze,1) // PHOS event analyzis , version 1 +ClassDef(AliPHOSAnalyze,1) // PHOSv0 event analyzis algorithm }; diff --git a/PHOS/AliPHOSClusterizer.cxx b/PHOS/AliPHOSClusterizer.cxx index 5a8ed337977..4a695559560 100644 --- a/PHOS/AliPHOSClusterizer.cxx +++ b/PHOS/AliPHOSClusterizer.cxx @@ -13,9 +13,12 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// A brief description of the class -//*-- Author : Yves Schutz SUBATECH +// Base class for the clusterization algorithm (pure abstract) +// +//*-- Author: Yves Schutz SUBATECH ////////////////////////////////////////////////////////////////////////////// // --- ROOT system --- diff --git a/PHOS/AliPHOSClusterizer.h b/PHOS/AliPHOSClusterizer.h index 6d7f5836b39..8cfeaca06d7 100644 --- a/PHOS/AliPHOSClusterizer.h +++ b/PHOS/AliPHOSClusterizer.h @@ -5,14 +5,9 @@ /* $Id$ */ -//////////////////////////////////////////////// -// Algorithme class for the clusterization // -// interface class // -// Version SUBATECH // -// Author Yves Schutz SUBATECH // -// // -// pABC // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// Base class for the clusterization algorithm (pure abstract) +//*-- Author: Yves Schutz (SUBATECH) // --- ROOT system --- @@ -25,8 +20,8 @@ #include "AliPHOSDigit.h" -typedef TClonesArray RecPointsList ; // a cluster has a variable size (see ROOT FAQ) -typedef TClonesArray DigitsList ; //for digits saved on disk +typedef TClonesArray RecPointsList ; +typedef TClonesArray DigitsList ; class AliPHOSClusterizer : public TObject { @@ -56,7 +51,7 @@ public: virtual void SetPpsdClusteringThreshold(Float_t cluth) = 0 ; virtual void SetPpsdEnergyThreshold(Float_t enth) = 0 ; - ClassDef(AliPHOSClusterizer,1) // clusterization interface, version 1 + ClassDef(AliPHOSClusterizer,1) // Clusterization algorithm class (abstract base class) } ; diff --git a/PHOS/AliPHOSClusterizerv1.cxx b/PHOS/AliPHOSClusterizerv1.cxx index af7f10c660d..ca906bf9249 100644 --- a/PHOS/AliPHOSClusterizerv1.cxx +++ b/PHOS/AliPHOSClusterizerv1.cxx @@ -13,9 +13,12 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// A brief description of the class -//*-- Author : Yves Schutz SUBATECH +// Implementation version 1 of the clusterization algorithm +// +//*-- Author: Yves Schutz (SUBATECH) ////////////////////////////////////////////////////////////////////////////// // --- ROOT system --- @@ -40,6 +43,8 @@ ClassImp(AliPHOSClusterizerv1) //____________________________________________________________________________ AliPHOSClusterizerv1::AliPHOSClusterizerv1() { + // default ctor (to be used) + fA = 0.; fB = 0.01 ; fNumberOfEmcClusters = 0 ; @@ -55,9 +60,13 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1() //____________________________________________________________________________ Int_t AliPHOSClusterizerv1::AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2) { - // neigbours are defined as digits having at least common vertex - // The order of A and B in AreNeighbours(A,B) is important: first (A) should be digit - // in cluster, which compared with digits not clusterized yet + // Gives the neighbourness of two digits = 0 are not neighbour but continue searching + // = 1 are neighbour + // = 2 are not neighbour but do not continue searching + // neighbours are defined as digits having at least common vertex + // The order of d1 and d2 is important: first (d1) should be a digit already in a cluster + // which is compared to a digit (d2) not yet in a cluster + Int_t rv = 0 ; AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ; @@ -94,7 +103,7 @@ Int_t AliPHOSClusterizerv1::AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2) //____________________________________________________________________________ void AliPHOSClusterizerv1::FillandSort(const DigitsList * dl, TObjArray * tl) { - // copies the digits with energy above thershold and sorts the list + // Copies the digits with energy above thershold and sorts the list // according to increasing Id number AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ; @@ -134,13 +143,18 @@ void AliPHOSClusterizerv1::FillandSort(const DigitsList * dl, TObjArray * tl) //____________________________________________________________________________ void AliPHOSClusterizerv1:: GetNumberOfClustersFound(Int_t * numb) { - numb[0] = fNumberOfEmcClusters ; - numb[1] = fNumberOfPpsdClusters ; + // Fills numb with the number of EMC (numb[0]) clusters found + // PPSD (numb[1]) clusters found + + numb[0] = fNumberOfEmcClusters ; + numb[1] = fNumberOfPpsdClusters ; } //____________________________________________________________________________ Bool_t AliPHOSClusterizerv1::IsInEmc(AliPHOSDigit * digit) { + // Tells if (true) or not (false) the digit is in a PHOS-EMC module + Bool_t rv = kFALSE ; AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ; @@ -157,7 +171,8 @@ Bool_t AliPHOSClusterizerv1::IsInEmc(AliPHOSDigit * digit) //____________________________________________________________________________ void AliPHOSClusterizerv1::MakeClusters(const DigitsList * dl, RecPointsList * emcl, RecPointsList * ppsdl) { - + // Steering method to construct the clusters stored in a list of Reconstructed Points + // A cluster is defined as a list of neighbour digits // Fill and sort the working digits list TObjArray tempodigitslist( dl->GetEntries() ) ; @@ -258,6 +273,8 @@ void AliPHOSClusterizerv1::MakeClusters(const DigitsList * dl, RecPointsList * e //____________________________________________________________________________ void AliPHOSClusterizerv1::PrintParameters() { + // Print the energy thresholds + cout << "PHOS Clusterizer version 1 :" << endl << " EMC Clustering threshold = " << fEmcClusteringThreshold << endl << " EMC Energy threshold = " << fEmcEnergyThreshold << endl diff --git a/PHOS/AliPHOSClusterizerv1.h b/PHOS/AliPHOSClusterizerv1.h index 71a352614d7..55c9009675d 100644 --- a/PHOS/AliPHOSClusterizerv1.h +++ b/PHOS/AliPHOSClusterizerv1.h @@ -5,14 +5,10 @@ /* $Id$ */ -//////////////////////////////////////////////// -// Clusterizer implementation version 1 // -// algorithme class // -// // -// Author Yves Schutz SUBATECH // -// // -// // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// Implementation version 1 of the clusterization algorithm +// +//*-- Author: Yves Schutz (SUBATECH) // --- ROOT system --- @@ -58,18 +54,18 @@ public: private: - Float_t fA ; - Float_t fB ; - Float_t fEmcClusteringThreshold ; - Float_t fEmcEnergyThreshold ; - Float_t fLocMaxCut ; - Int_t fNumberOfEmcClusters ; - Int_t fNumberOfPpsdClusters ; - Float_t fPpsdClusteringThreshold ; - Float_t fPpsdEnergyThreshold ; - Float_t fW0 ; + Float_t fA ; // offset of the energy calibration + Float_t fB ; // gain of the energy calibration + Float_t fEmcClusteringThreshold ; // minimum energy to include a EMC digit in a cluster + Float_t fEmcEnergyThreshold ; // minimum energy of EMC digit to be considered + Float_t fLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster + Int_t fNumberOfEmcClusters ; // number of EMC clusters found + Int_t fNumberOfPpsdClusters ; // number of PPSD clusters found + Float_t fPpsdClusteringThreshold ; // minimum energy to include a PPSD digit in a cluster + Float_t fPpsdEnergyThreshold ; // minimum energy of PPSD digit to be considered + Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation - ClassDef(AliPHOSClusterizerv1,1) // Clusterizer implementation , version 1 + ClassDef(AliPHOSClusterizerv1,1) // Clusterizer implementation version 1 }; diff --git a/PHOS/AliPHOSDigit.cxx b/PHOS/AliPHOSDigit.cxx index e6836413128..8c4d922c889 100644 --- a/PHOS/AliPHOSDigit.cxx +++ b/PHOS/AliPHOSDigit.cxx @@ -13,17 +13,24 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Digit class for PHOS that contains an absolute ID and an energy -//*-- Author : Laurent Aphecetche SUBATECH -////////////////////////////////////////////////////////////////////////////// +// PHOS digit: Id +// energy +// 3 identifiers for the primary particle(s) at the origine of the digit +// The digits are made in FinishEvent() by summing all the hits in a single PHOS crystal or PPSD gas cell +// It would be nice to replace the 3 identifiers by an array, but, because digits are kept in a TClonesQArray, +// it is not possible to stream such an array... (beyond my understqnding!) +// +//*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH) + // --- ROOT system --- // --- Standard library --- #include -#include // --- AliRoot header files --- @@ -35,6 +42,8 @@ ClassImp(AliPHOSDigit) //____________________________________________________________________________ AliPHOSDigit::AliPHOSDigit() { + // default ctor + fNprimary = 0 ; fPrimary1 = -1 ; fPrimary2 = -1 ; @@ -44,6 +53,8 @@ ClassImp(AliPHOSDigit) //____________________________________________________________________________ AliPHOSDigit::AliPHOSDigit(Int_t primary, Int_t id, Int_t DigEnergy) { + // ctor with all data + fId = id ; fAmp = DigEnergy ; fPrimary1 = primary ; @@ -52,7 +63,9 @@ AliPHOSDigit::AliPHOSDigit(Int_t primary, Int_t id, Int_t DigEnergy) //____________________________________________________________________________ AliPHOSDigit::AliPHOSDigit(const AliPHOSDigit & digit) -{ +{ + // copy ctor + fId = digit.fId; fAmp = digit.fAmp ; fNprimary = digit.fNprimary ; @@ -61,14 +74,12 @@ AliPHOSDigit::AliPHOSDigit(const AliPHOSDigit & digit) fPrimary3 = digit.fPrimary3 ; } -//____________________________________________________________________________ -AliPHOSDigit::~AliPHOSDigit() -{ -} - //____________________________________________________________________________ Int_t AliPHOSDigit::Compare(TObject * obj) { + // Compares two digits with respect to its Id + // to sort according increasing Id + Int_t rv ; AliPHOSDigit * digit = (AliPHOSDigit *)obj ; @@ -89,6 +100,8 @@ Int_t AliPHOSDigit::Compare(TObject * obj) //____________________________________________________________________________ Int_t AliPHOSDigit::GetPrimary(Int_t index) const { + // Returns the primary particle id index =1,2,3 + Int_t rv = -1 ; if ( index > 3 ) cout << "AliPHOSDigit ERROR > only 3 primaries allowed" << endl ; @@ -113,6 +126,8 @@ Int_t AliPHOSDigit::GetPrimary(Int_t index) const //____________________________________________________________________________ Bool_t AliPHOSDigit::operator==(AliPHOSDigit const & digit) const { + // Two digits are equal if they have the same Id + if ( fId == digit.fId ) return kTRUE ; else @@ -122,6 +137,8 @@ Bool_t AliPHOSDigit::operator==(AliPHOSDigit const & digit) const //____________________________________________________________________________ AliPHOSDigit& AliPHOSDigit::operator+(AliPHOSDigit const & digit) { + // Adds the amplitude of digits and completes the list of primary particles + fAmp += digit.fAmp ; // Here comes something crummy ... but I do not know how to stream pointers @@ -170,7 +187,12 @@ AliPHOSDigit& AliPHOSDigit::operator+(AliPHOSDigit const & digit) //____________________________________________________________________________ ostream& operator << ( ostream& out , const AliPHOSDigit & digit) { - out << "ID " << digit.fId << " Energy = " << digit.fAmp ; + // Prints the data of the digit + + out << "ID " << digit.fId << " Energy = " << digit.fAmp << endl + << "Primary 1 = " << digit.fPrimary1 << endl + << "Primary 2 = " << digit.fPrimary2 << endl + << "Primary 3 = " << digit.fPrimary3 << endl ; return out ; } diff --git a/PHOS/AliPHOSDigit.h b/PHOS/AliPHOSDigit.h index 190de898d65..c403f3e44a9 100644 --- a/PHOS/AliPHOSDigit.h +++ b/PHOS/AliPHOSDigit.h @@ -5,13 +5,15 @@ /* $Id$ */ -//////////////////////////////////////////////// -// The digit class: a list of abs Id, energy// -// Version SUBATECH // -// Author Laurent Aphecetche SUBATECH // -// comment: added sortable YS // -// // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// PHOS digit: Id +// energy +// 3 identifiers for the primary particle(s) at the origine of the digit +// The digits are made in FinishEvent() by summing all the hits in a single PHOS crystal or PPSD gas cell +// It would be nice to replace the 3 identifiers by an array, but, because digits are kept in a TClonesQArray, +// it is not possible to stream such an array... (beyond my understqnding!) +// +//*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH) // --- ROOT system --- @@ -30,7 +32,7 @@ public: AliPHOSDigit() ; AliPHOSDigit(Int_t primary, Int_t id, Int_t DigEnergy) ; AliPHOSDigit(const AliPHOSDigit & digit) ; - virtual ~AliPHOSDigit() ; + virtual ~AliPHOSDigit(){} Bool_t operator==(AliPHOSDigit const &rValue) const; AliPHOSDigit& operator+(AliPHOSDigit const &rValue) ; @@ -50,7 +52,7 @@ private: Int_t fPrimary3 ; // third primary (because I do not know how to stream *fPrimary) Int_t fNprimary ; // Number of primaries - ClassDef(AliPHOSDigit,1) // Digit in PHOS, version 1 + ClassDef(AliPHOSDigit,1) // Digit in PHOS } ; diff --git a/PHOS/AliPHOSEmcRecPoint.cxx b/PHOS/AliPHOSEmcRecPoint.cxx index df8047056ea..a1f572689f8 100644 --- a/PHOS/AliPHOSEmcRecPoint.cxx +++ b/PHOS/AliPHOSEmcRecPoint.cxx @@ -13,10 +13,14 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Rec Point in the PHOS EM calorimeter -//*-- Author : Dmitri Peressounko RRC KI -////////////////////////////////////////////////////////////////////////////// +// RecPoint implementation for PHOS-EMC +// An EmcRecPoint is a cluster of digits +// +//*-- Author: Dmitri Peressounko (RRC KI & SUBATECH) + // --- ROOT system --- #include "TPad.h" @@ -52,17 +56,11 @@ AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(Float_t W0, Float_t LocMaxCut) fLocPos.SetX(1000000.) ; //Local position should be evaluated } -//____________________________________________________________________________ -AliPHOSEmcRecPoint::~AliPHOSEmcRecPoint() -{ - // dtor -} - //____________________________________________________________________________ void AliPHOSEmcRecPoint::AddDigit(AliDigitNew & digit, Float_t Energy) { - // adds a digit to the digits list - // and accumulates the total amplitude and the multiplicity + // Adds a digit to the RecPoint + // and accumulates the total amplitude and the multiplicity if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists fMaxDigit*=2 ; @@ -98,6 +96,7 @@ void AliPHOSEmcRecPoint::AddDigit(AliDigitNew & digit, Float_t Energy) //____________________________________________________________________________ Bool_t AliPHOSEmcRecPoint::AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) { + // Tells if (true) or not (false) two digits are neighbors) Bool_t aren = kFALSE ; @@ -120,6 +119,8 @@ Bool_t AliPHOSEmcRecPoint::AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * d //____________________________________________________________________________ Int_t AliPHOSEmcRecPoint::Compare(TObject * obj) { + // Compares two RecPoints according to their position in the PHOS modules + Int_t rv ; AliPHOSEmcRecPoint * clu = (AliPHOSEmcRecPoint *)obj ; @@ -158,7 +159,7 @@ Int_t AliPHOSEmcRecPoint::Compare(TObject * obj) //______________________________________________________________________________ void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) { - //Execute action corresponding to one event + // 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 @@ -259,6 +260,8 @@ void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) //____________________________________________________________________________ Float_t AliPHOSEmcRecPoint::GetDispersion() { + // Calculates the dispersion of the shower at the origine of the RecPoint + Float_t d = 0 ; Float_t wtot = 0 ; @@ -266,7 +269,6 @@ Float_t AliPHOSEmcRecPoint::GetDispersion() GetLocalPosition(locpos); Float_t x = locpos.X() ; Float_t z = locpos.Z() ; - // Int_t i = GetPHOSMod() ; AliPHOSDigit * digit ; AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ; @@ -292,6 +294,8 @@ Float_t AliPHOSEmcRecPoint::GetDispersion() //____________________________________________________________________________ void AliPHOSEmcRecPoint::GetElipsAxis(Float_t * lambda) { + // Calculates the axis of the shower ellipsoid + Float_t wtot = 0. ; Float_t x = 0.; Float_t z = 0.; @@ -332,9 +336,58 @@ void AliPHOSEmcRecPoint::GetElipsAxis(Float_t * lambda) lambda[1] = TMath::Sqrt( 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ) ; } +//____________________________________________________________________________ +void AliPHOSEmcRecPoint::GetLocalPosition(TVector3 &LPos) +{ + // Calculates the center of gravity in the local PHOS-module coordinates + + if( fLocPos.X() < 1000000.) { // already evaluated + LPos = fLocPos ; + return ; + } + + Float_t wtot = 0. ; + + Int_t relid[4] ; + + Float_t x = 0. ; + Float_t z = 0. ; + + AliPHOSDigit * digit ; + + AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ; + + Int_t iDigit; + + + for(iDigit=0; iDigitAbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->RelPosInModule(relid, xi, zi); + Float_t w = TMath::Max( 0., fW0 + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ; + x += xi * w ; + z += zi * w ; + wtot += w ; + + } + + x /= wtot ; + z /= wtot ; + fLocPos.SetX(x) ; + fLocPos.SetY(0.) ; + fLocPos.SetZ(z) ; + + LPos = fLocPos ; +} + //____________________________________________________________________________ Float_t AliPHOSEmcRecPoint::GetMaximalEnergy(void) { + // Finds the maximum energy in the cluster + Float_t menergy = 0. ; Int_t iDigit; @@ -350,6 +403,8 @@ Float_t AliPHOSEmcRecPoint::GetMaximalEnergy(void) //____________________________________________________________________________ Int_t AliPHOSEmcRecPoint::GetMultiplicityAtLevel(Float_t H) { + // Calculates the multiplicity of digits with energy larger than H*energy + Int_t multipl = 0 ; Int_t iDigit ; for(iDigit=0; iDigitAbsToRelNumbering(digit->GetId(), relid) ; - phosgeom->RelPosInModule(relid, xi, zi); - Float_t w = TMath::Max( 0., fW0 + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ; - x += xi * w ; - z += zi * w ; - wtot += w ; - - } - - x /= wtot ; - z /= wtot ; - fLocPos.SetX(x) ; - fLocPos.SetY(0.) ; - fLocPos.SetZ(z) ; - - LPos = fLocPos ; -} // //____________________________________________________________________________ // AliPHOSEmcRecPoint& AliPHOSEmcRecPoint::operator = (AliPHOSEmcRecPoint Clu) @@ -492,6 +506,8 @@ void AliPHOSEmcRecPoint::GetLocalPosition(TVector3 &LPos) //____________________________________________________________________________ void AliPHOSEmcRecPoint::Print(Option_t * option) { + // Print the list of digits belonging to the cluster + cout << "AliPHOSEmcRecPoint: " << endl ; AliPHOSDigit * digit ; @@ -520,8 +536,9 @@ void AliPHOSEmcRecPoint::Print(Option_t * option) //______________________________________________________________________________ void AliPHOSEmcRecPoint::Streamer(TBuffer &R__b) { - // Stream an object of class AliPHOSEmcRecPoint. - + // Stream an object of class AliPHOSEmcRecPoint. + // Needed because of the array fEnergyList + if (R__b.IsReading()) { Version_t R__v = R__b.ReadVersion(); if (R__v) { } AliPHOSRecPoint::Streamer(R__b); diff --git a/PHOS/AliPHOSEmcRecPoint.h b/PHOS/AliPHOSEmcRecPoint.h index d8a9a72cbfa..e040b9e8d98 100644 --- a/PHOS/AliPHOSEmcRecPoint.h +++ b/PHOS/AliPHOSEmcRecPoint.h @@ -5,13 +5,11 @@ /* $Id$ */ -////////////////////////////////////////////////// -// Rec Point in the EM calorimeter of PHOS // -// // -// Author Dmitri Peressounko RRC KI // -// comment: contains list of AliPHOSDigit's * // -// and evaluates a few average values // -////////////////////////////////////////////////// +//_________________________________________________________________________ +// RecPoint implementation for PHOS-EMC +// An EmcRecPoint is a cluster of digits +// +//*-- Author: Dmitri Peressounko (RRC KI & SUBATECH) // --- ROOT system --- @@ -30,7 +28,8 @@ public: AliPHOSEmcRecPoint(){} ; AliPHOSEmcRecPoint(Float_t W0, Float_t LocMaxCut) ; - virtual ~AliPHOSEmcRecPoint() ; + virtual ~AliPHOSEmcRecPoint(){} + void AddDigit(AliDigitNew & digit, Float_t Energy) ; // add a digit to the digits list Int_t Compare(TObject * obj) ; // method for sorting @@ -57,12 +56,12 @@ private: Bool_t AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) ; - Float_t fDelta ; // parameter used to sort the clusters - Float_t fLocMaxCut ; // parameter used for local maximum searc + Float_t fDelta ; // parameter used to sort the clusters + Float_t fLocMaxCut ; // minimum energy difference to distinguish two maxima Float_t * fEnergyList ; // energy of digits Float_t fW0 ; // logarithmic weight factor for center of gravity calculation - ClassDef(AliPHOSEmcRecPoint,1) // EMC RecPoint, version 1 + ClassDef(AliPHOSEmcRecPoint,1) // EMC RecPoint (cluster) }; diff --git a/PHOS/AliPHOSFastRecParticle.cxx b/PHOS/AliPHOSFastRecParticle.cxx index 9b9f4e042a9..29ee284a881 100644 --- a/PHOS/AliPHOSFastRecParticle.cxx +++ b/PHOS/AliPHOSFastRecParticle.cxx @@ -13,10 +13,13 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Particle modified by PHOS response to be used by AliPHOSvFast -//*-- Y. Schutz: SUBATECH -////////////////////////////////////////////////////////////////////////////// +// A Particle modified by PHOS response and produced by AliPHOSvFast +// To become a general class of AliRoot ? +// +//*-- Author: Yves Schutz (SUBATECH) // --- ROOT system --- @@ -35,6 +38,8 @@ ClassImp(AliPHOSFastRecParticle) //____________________________________________________________________________ AliPHOSFastRecParticle::AliPHOSFastRecParticle(const AliPHOSFastRecParticle & rp) { + // copy ctor + fType = rp.fType ; fPdgCode = rp.fPdgCode; fStatusCode = rp.fStatusCode; @@ -60,6 +65,8 @@ ClassImp(AliPHOSFastRecParticle) //____________________________________________________________________________ AliPHOSFastRecParticle::AliPHOSFastRecParticle(const TParticle & pp) { + // ctor from a TParticle (crummy?!) + TParticle & pnoconst = const_cast(pp) ; AliPHOSFastRecParticle & p = static_cast(pnoconst) ; @@ -84,11 +91,6 @@ ClassImp(AliPHOSFastRecParticle) fParticlePDG = p.fParticlePDG; } -//____________________________________________________________________________ - AliPHOSFastRecParticle::~AliPHOSFastRecParticle() -{ -} - //____________________________________________________________________________ Int_t AliPHOSFastRecParticle::DistancetoPrimitive(Int_t px, Int_t py) { @@ -121,8 +123,7 @@ void AliPHOSFastRecParticle::ExecuteEvent(Int_t event, Int_t px, Int_t py) { // Execute action corresponding to one event // This member function is called when a AliPHOSFastRecParticle is clicked with the locator - // - + if (!gPad->IsEditable()) return ; @@ -156,9 +157,24 @@ void AliPHOSFastRecParticle::ExecuteEvent(Int_t event, Int_t px, Int_t py) } } + +//____________________________________________________________________________ +Int_t * AliPHOSFastRecParticle::GetPrimaries(Int_t & number) +{ + // Retrieves the unique primary particle at the origine of the present reconstruced particle + + number = 1 ; + Int_t * list = new Int_t[1] ; + list[0] = fPrimary ; + + return list ; +} + //____________________________________________________________________________ TString AliPHOSFastRecParticle::Name() { + // Returns the name of the particle type + TString name ; switch (fType) { case kGAMMA: @@ -190,27 +206,29 @@ TString AliPHOSFastRecParticle::Name() //______________________________________________________________________________ void AliPHOSFastRecParticle::Paint(Option_t *) { -// Paint this ALiRecParticle in theta,phi coordinate as a TMarker with its current attributes + // Paint this ALiRecParticle in theta,phi coordinate as a TMarker with its current attributes Double_t kRADDEG = 180. / TMath::Pi() ; - Coord_t x = Phi() * kRADDEG ; - Coord_t y = Theta() * kRADDEG ; - Color_t markercolor = 1 ; - Size_t markersize = 1. ; - Style_t markerstyle = 5 ; - - if (!gPad->IsBatch()) { - gVirtualX->SetMarkerColor(markercolor) ; - gVirtualX->SetMarkerSize (markersize) ; - gVirtualX->SetMarkerStyle(markerstyle) ; - } - gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ; - gPad->PaintPolyMarker(1,&x,&y,"") ; + Coord_t x = Phi() * kRADDEG ; + Coord_t y = Theta() * kRADDEG ; + Color_t markercolor = 1 ; + Size_t markersize = 1. ; + Style_t markerstyle = 5 ; + + if (!gPad->IsBatch()) { + gVirtualX->SetMarkerColor(markercolor) ; + gVirtualX->SetMarkerSize (markersize) ; + gVirtualX->SetMarkerStyle(markerstyle) ; + } + gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ; + gPad->PaintPolyMarker(1,&x,&y,"") ; } //____________________________________________________________________________ void AliPHOSFastRecParticle::Print() { + // Print the typr, energy and momentum + cout << "AliPHOSFastRecParticle > " << "type is " << Name() << endl << " " << "Energy = " << fE << endl << " " << "Px = " << fPx << endl diff --git a/PHOS/AliPHOSFastRecParticle.h b/PHOS/AliPHOSFastRecParticle.h index e4e026ef978..1a5aa93a45c 100644 --- a/PHOS/AliPHOSFastRecParticle.h +++ b/PHOS/AliPHOSFastRecParticle.h @@ -5,12 +5,11 @@ /* $Id$ */ -//////////////////////////////////////////////// -// A Particle modified by PHOS response // -// Yves Schutz SUBATECH // -// To become a general class of AliRoot ? // -// // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// A Particle modified by PHOS response and produced by AliPHOSvFast +// To become a general class of AliRoot ? +// +//*-- Author: Yves Schutz (SUBATECH) // --- ROOT system --- @@ -21,9 +20,8 @@ // --- AliRoot header files --- -//#include "AliPHOSRecParticle.h" - typedef TClonesArray FastRecParticlesList ; + const static Int_t kUNDEFINED = -1; const static Int_t kGAMMA = 0 ; const static Int_t kELECTRON = 1 ; @@ -42,22 +40,25 @@ public: AliPHOSFastRecParticle() {}; // ctor AliPHOSFastRecParticle(const AliPHOSFastRecParticle & rp) ; // ctor AliPHOSFastRecParticle(const TParticle & p) ; // ctor - virtual ~AliPHOSFastRecParticle() ; // dtor + virtual ~AliPHOSFastRecParticle(){} // dtor 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) ; + virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) ; + virtual Int_t * GetPrimaries(Int_t & number) ; Int_t GetType() { return fType ; } TString Name() ; virtual void Paint(Option_t * option=""); void Print() ; + void SetPrimary(Int_t index) { fPrimary = index ; } void SetType(Int_t type) { fType = type ; } protected: - Int_t fType ; // identified particle type + Int_t fType ; // particle type obtained by "virtual" reconstruction + Int_t fPrimary ; // (unique) primary particle index - ClassDef(AliPHOSFastRecParticle,1) // Reconstructed Particle, version 1 + ClassDef(AliPHOSFastRecParticle,1) // Reconstructed Particle produced by the fast simulation }; diff --git a/PHOS/AliPHOSGeometry.cxx b/PHOS/AliPHOSGeometry.cxx index 51c75ff2f07..fe087f90a3d 100644 --- a/PHOS/AliPHOSGeometry.cxx +++ b/PHOS/AliPHOSGeometry.cxx @@ -13,10 +13,14 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Geometry class for PHOS version SUBATECH -//*-- Author : Y. Schutz SUBATECH -////////////////////////////////////////////////////////////////////////////// +// Geometry class for PHOS : singleton +// The EMC modules are parametrized so that any configuration can be easily implemented +// The title is used to identify the type of CPV used. So far only PPSD implemented +// +//*-- Author: Yves Schutz (SUBATECH) // --- ROOT system --- @@ -26,7 +30,6 @@ // --- Standard library --- #include -#include // --- AliRoot header files --- @@ -41,6 +44,8 @@ ClassImp(AliPHOSGeometry) //____________________________________________________________________________ AliPHOSGeometry::~AliPHOSGeometry(void) { + // dtor + fRotMatrixArray->Delete() ; delete fRotMatrixArray ; } @@ -48,11 +53,12 @@ AliPHOSGeometry::~AliPHOSGeometry(void) //____________________________________________________________________________ Bool_t AliPHOSGeometry::AbsToRelNumbering(const Int_t AbsId, Int_t * relid) { - // relid[0] = PHOS Module number 1:fNModules - // relid[1] = 0 if PbW04 - // = PPSD Module number 1:fNumberOfModulesPhi*fNumberOfModulesZ*2 (2->up and bottom level) - // relid[2] = Row number inside a PHOS or PPSD module - // relid[3] = Column number inside a PHOS or PPSD module + // Converts the absolute numbering into the following array/ + // relid[0] = PHOS Module number 1:fNModules + // relid[1] = 0 if PbW04 + // = PPSD Module number 1:fNumberOfModulesPhi*fNumberOfModulesZ*2 (2->up and bottom level) + // relid[2] = Row number inside a PHOS or PPSD module + // relid[3] = Column number inside a PHOS or PPSD module Bool_t rv = kTRUE ; Float_t id = AbsId ; @@ -166,7 +172,8 @@ void AliPHOSGeometry::ImpactOnEmc(const Double_t theta, const Double_t phi, Int_ //____________________________________________________________________________ void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrix & gmat) { - + // Calculates the ALICE global coordinates of a RecPoint and the error matrix + AliPHOSRecPoint * tmpPHOS = (AliPHOSRecPoint *) RecPoint ; TVector3 localposition ; @@ -206,6 +213,8 @@ void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TM //____________________________________________________________________________ void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) { + // Calculates the ALICE global coordinates of a RecPoint + AliPHOSRecPoint * tmpPHOS = (AliPHOSRecPoint *) RecPoint ; TVector3 localposition ; tmpPHOS->GetLocalPosition(gpos) ; @@ -242,6 +251,8 @@ void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) //____________________________________________________________________________ void AliPHOSGeometry::Init(void) { + // Initializes the PHOS parameters + fRotMatrixArray = new TObjArray(fNModules) ; cout << "PHOS geometry setup: parameters for option " << fName << " " << fTitle << endl ; @@ -260,7 +271,7 @@ void AliPHOSGeometry::Init(void) //____________________________________________________________________________ void AliPHOSGeometry::InitPHOS(void) { - // PHOS + // Initializes the EMC parameters fNPhi = 64 ; fNZ = 64 ; @@ -335,7 +346,7 @@ void AliPHOSGeometry::InitPHOS(void) //____________________________________________________________________________ void AliPHOSGeometry::InitPPSD(void) { - // PPSD + // Initializes the PPSD parameters fAnodeThickness = 0.0009 ; fAvalancheGap = 0.01 ; @@ -375,12 +386,16 @@ void AliPHOSGeometry::InitPPSD(void) //____________________________________________________________________________ AliPHOSGeometry * AliPHOSGeometry::GetInstance() { + // Returns the pointer of the unique instance + return (AliPHOSGeometry *) fGeom ; } //____________________________________________________________________________ AliPHOSGeometry * AliPHOSGeometry::GetInstance(const Text_t* name, const Text_t* title) { + // Returns the pointer of the unique instance + AliPHOSGeometry * rv = 0 ; if ( fGeom == 0 ) { fGeom = new AliPHOSGeometry(name, title) ; @@ -400,9 +415,9 @@ AliPHOSGeometry * AliPHOSGeometry::GetInstance(const Text_t* name, const Text_t //____________________________________________________________________________ Bool_t AliPHOSGeometry::RelToAbsNumbering(const Int_t * relid, Int_t & AbsId) { - - // AbsId = 1:fNModules * fNPhi * fNZ -> PbWO4 - // AbsId = 1:fNModules * 2 * (fNumberOfModulesPhi * fNumberOfModulesZ) * fNumberOfPadsPhi * fNumberOfPadsZ -> PPSD + // Converts the relative numbering into the absolute numbering + // AbsId = 1:fNModules * fNPhi * fNZ -> PbWO4 + // AbsId = 1:fNModules * 2 * (fNumberOfModulesPhi * fNumberOfModulesZ) * fNumberOfPadsPhi * fNumberOfPadsZ -> PPSD Bool_t rv = kTRUE ; @@ -430,6 +445,8 @@ Bool_t AliPHOSGeometry::RelToAbsNumbering(const Int_t * relid, Int_t & AbsId) void AliPHOSGeometry::RelPosInAlice(const Int_t id, TVector3 & pos ) { + // Converts the absolute numbering into the global ALICE coordinates + if (id > 0) { Int_t relid[4] ; @@ -484,6 +501,8 @@ void AliPHOSGeometry::RelPosInAlice(const Int_t id, TVector3 & pos ) //____________________________________________________________________________ void AliPHOSGeometry::RelPosInModule(const Int_t * relid, Float_t & x, Float_t & z) { + // Converts the relative numbering into the local PHOS-module (x, z) coordinates + Int_t ppsdmodule ; Int_t row = relid[2] ; //offset along z axiz Int_t column = relid[3] ; //offset along x axiz @@ -511,6 +530,8 @@ void AliPHOSGeometry::RelPosInModule(const Int_t * relid, Float_t & x, Float_t & //____________________________________________________________________________ void AliPHOSGeometry::SetPHOSAngles() { + // Calculates the position in ALICE of the PHOS modules + Double_t const kRADDEG = 180.0 / kPI ; Float_t pphi = TMath::ATan( fOuterBoxSize[0] / ( 2.0 * fIPtoOuterCoverDistance ) ) ; pphi *= kRADDEG ; @@ -525,6 +546,7 @@ void AliPHOSGeometry::SetPHOSAngles() void AliPHOSGeometry::SetLeadConverterThickness(Float_t e) { // should ultimately disappear + cout << " AliPHOSGeometry WARNING : You have changed LeadConverterThickness from " << fLeadConverterThickness << " to " << e << endl ; diff --git a/PHOS/AliPHOSGeometry.h b/PHOS/AliPHOSGeometry.h index 1950901437a..936810af6b8 100644 --- a/PHOS/AliPHOSGeometry.h +++ b/PHOS/AliPHOSGeometry.h @@ -5,13 +5,12 @@ /* $Id$ */ -//////////////////////////////////////////////// -// Geometry class for PHOS : singleton // -// Version SUBATECH // -// Author Y. Schutz SUBATECH // -// geometry parametrized for any // -// shape of modules // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// Geometry class for PHOS : singleton +// The EMC modules are parametrized so that any configuration can be easily implemented +// The title is used to identify the type of CPV used. So far only PPSD implemented +// +//*-- Author: Yves Schutz (SUBATECH) // --- ROOT system --- @@ -32,7 +31,7 @@ class AliPHOSGeometry : public AliGeometry { public: - AliPHOSGeometry() {} ; // must be kept public for root persistency purposes + AliPHOSGeometry() {} ; // must be kept public for root persistency purposes, but should never be called by the outside world virtual ~AliPHOSGeometry(void) ; static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title) ; static AliPHOSGeometry * GetInstance() ; @@ -50,9 +49,9 @@ public: // General - Bool_t AbsToRelNumbering(const Int_t AbsId, Int_t * RelId) ; // converts the absolute PHOS numbering to a relative + Bool_t AbsToRelNumbering(const Int_t AbsId, Int_t * RelId) ; // converts the absolute PHOS numbering to a relative void EmcModuleCoverage(const Int_t m, Double_t & tm, Double_t & tM, Double_t & pm, Double_t & pM, Option_t * opt = kRadian); - // calculates the angular coverage in theta and phi of a EMC module + // calculates the angular coverage in theta and phi of a EMC module void EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt = kRadian) ; // calculates the angular coverage in theta and phi of a // single crystal in a EMC module @@ -77,6 +76,8 @@ public: Float_t GetGapBetweenCrystals(void) const { return fGapBetweenCrystals ; } Float_t GetIPtoCrystalSurface(void) const { return fIPtoCrystalSurface ; } Float_t GetIPtoOuterCoverDistance(void) const { return fIPtoOuterCoverDistance ; } + Float_t GetIPtoPpsdUp(void) const { return (fIPtoOuterCoverDistance - fPPSDBoxSize[1] + fPPSDModuleSize[1]/2 ); } + Float_t GetIPtoPpsdLow(void) const { return (fIPtoOuterCoverDistance - fPPSDModuleSize[1]/2 ); } Float_t GetIPtoTopLidDistance(void) const { return fIPtoTopLidDistance ; } Float_t GetLowerThermoPlateThickness(void) const { return fLowerThermoPlateThickness ; } Float_t GetLowerTextolitPlateThickness(void) const { return fLowerTextolitPlateThickness ; } @@ -188,7 +189,7 @@ private: static AliPHOSGeometry * fGeom ; // pointer to the unique instance of the singleton - ClassDef(AliPHOSGeometry,1) // PHOS geometry class , version subatech + ClassDef(AliPHOSGeometry,1) // PHOS geometry class } ; diff --git a/PHOS/AliPHOSHit.cxx b/PHOS/AliPHOSHit.cxx index afe9fae8221..4864a7bf7da 100644 --- a/PHOS/AliPHOSHit.cxx +++ b/PHOS/AliPHOSHit.cxx @@ -13,10 +13,13 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Hit classes for PHOS -//*-- Author : Maxim Volkov, RRC KI -////////////////////////////////////////////////////////////////////////////// +// Hits class for PHOS +// A hit in PHOS is the sum of all hits in a single crystal +// +//*-- Author: Maxime Volkov (RRC KI) & Yves Schutz (SUBATECH) // --- ROOT system --- @@ -25,7 +28,6 @@ #include #include #include -#include // --- AliRoot header files --- #include "AliPHOSHit.h" @@ -38,7 +40,8 @@ ClassImp(AliPHOSHit) //____________________________________________________________________________ AliPHOSHit::AliPHOSHit(Int_t primary, Int_t id, Float_t *hits) { - + // ctor + fId = id ; fX = hits[0] ; fY = hits[1] ; @@ -50,6 +53,8 @@ AliPHOSHit::AliPHOSHit(Int_t primary, Int_t id, Float_t *hits) //____________________________________________________________________________ Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const { + // Two hits are identical if they have the same Id and originate from the same primary + Bool_t rv = kFALSE ; if ( fId == rValue.GetId() && fPrimary == rValue.GetPrimary() ) @@ -61,6 +66,7 @@ Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const //____________________________________________________________________________ AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) const { + // Add the energy of the hit AliPHOSHit added(*this); @@ -70,8 +76,6 @@ AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) const added.fELOS += rValue.GetEnergy() ; - assert ( added.fPrimary == rValue.fPrimary ) ; - return added; } @@ -79,6 +83,8 @@ AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) const //____________________________________________________________________________ ostream& operator << (ostream& out, const AliPHOSHit& hit) { + // Print out Id and energy + out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << endl ; return out ; } diff --git a/PHOS/AliPHOSHit.h b/PHOS/AliPHOSHit.h index d7389999c96..57b911e3508 100644 --- a/PHOS/AliPHOSHit.h +++ b/PHOS/AliPHOSHit.h @@ -3,22 +3,14 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -//////////////////////////////////////////////// -// Hits class for PHOS // -// Version SUBATECH // -// A hit in PHOS is the sum of all hits in a // -// a single crystal due to one ans only one // -// primary particle // -// Author M. Volkov, RRC KI // -// october 1999: // -// Modified by Y. Schutz SUBATECH // -// january 2000: // -// Modified by Y. Schutz SUBATECH // -// added fPrimary // -//////////////////////////////////////////////// - /* $Id$ */ +//_________________________________________________________________________ +// Hits class for PHOS +// A hit in PHOS is the sum of all hits in a single crystal +// +//*-- Author: Maxime Volkov (RRC KI) & Yves Schutz (SUBATECH) + // --- ROOT system --- // --- AliRoot header files --- @@ -51,7 +43,7 @@ private: Float_t fELOS ; // Energy deposited Int_t fPrimary ; // Primary particles at the origine of the hit - ClassDef(AliPHOSHit,1) // Hits object for PHOS + ClassDef(AliPHOSHit,1) // Hit for PHOS } ; diff --git a/PHOS/AliPHOSLink.cxx b/PHOS/AliPHOSLink.cxx index 1a78b242721..6391a34009e 100644 --- a/PHOS/AliPHOSLink.cxx +++ b/PHOS/AliPHOSLink.cxx @@ -13,10 +13,12 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Auxiliary class, used ONLY by AliPHOSTrackSegmentMaker -//*-- Author : Dmitri Peressounko SUBATECH -////////////////////////////////////////////////////////////////////////////// +// Algorithm class used only by AliPHOSTrackSegmentMaker +// +//*-- Author: Dmitri Peressounko (SUBATECH) // --- ROOT system --- @@ -30,6 +32,8 @@ ClassImp(AliPHOSLink) //____________________________________________________________________________ AliPHOSLink::AliPHOSLink(Float_t r, Int_t Emc, Int_t Ppsd) { + // ctor + fR = r ; fEmcN = Emc ; fPpsdN = Ppsd ; @@ -38,6 +42,8 @@ ClassImp(AliPHOSLink) //____________________________________________________________________________ Int_t AliPHOSLink::Compare(TObject * obj) { + // Compare according to the distance between EMC and PPSD RecPoints in a track segment + Int_t rv ; AliPHOSLink * link = (AliPHOSLink *) obj ; diff --git a/PHOS/AliPHOSLink.h b/PHOS/AliPHOSLink.h index fa01ce9dee0..7d5c5e3a00b 100644 --- a/PHOS/AliPHOSLink.h +++ b/PHOS/AliPHOSLink.h @@ -5,13 +5,10 @@ /* $Id$ */ -//////////////////////////////////////////////// -// Short description // -// Version SUBATECH // -// Author Dmitri Peressounko SUBATECH // -// comment: auxiliary class used ONLY // -// by AliPHOSTrackSegmentMaker // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// Algorithm class used only by AliPHOSTrackSegmentMaker +// +//*-- Author: Dmitri Peressounko (SUBATECH) // --- ROOT system --- @@ -38,9 +35,9 @@ private: Int_t fEmcN ; // Emc index Int_t fPpsdN ; // Ppsd index - Float_t fR ; // Distance + Float_t fR ; // Distance between EMC and PPSD RecPoints in a track segment - ClassDef(AliPHOSLink,1) // description , version 1 + ClassDef(AliPHOSLink,1) // Auxilliary algorithm class used by AliPHOSTrackSegmentMaker }; diff --git a/PHOS/AliPHOSPID.cxx b/PHOS/AliPHOSPID.cxx index b7958b7d897..65456912e09 100644 --- a/PHOS/AliPHOSPID.cxx +++ b/PHOS/AliPHOSPID.cxx @@ -13,11 +13,14 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// To identify the type of particle detected in PHOS with or without the help -// from other detectors -//*-- Author : Yves Schutz SUBATECH -////////////////////////////////////////////////////////////////////////////// +// Algorithm class for the identification of particles detected in PHOS +// base class +// +//*-- Author: Yves Schutz (SUBATECH) + // --- ROOT system --- diff --git a/PHOS/AliPHOSPID.h b/PHOS/AliPHOSPID.h index f538eb0d1de..480e6f2577d 100644 --- a/PHOS/AliPHOSPID.h +++ b/PHOS/AliPHOSPID.h @@ -5,15 +5,11 @@ /* $Id$ */ -//////////////////////////////////////////////// -// Algorithme class for the identification of// -// particles detected in PHOS // -// base class // -// Version SUBATECH // -// Author Yves Schutz SUBATECH // -// // -// pABC // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// Algorithm class for the identification of particles detected in PHOS +// base class +// +//*-- Author: Yves Schutz (SUBATECH) // --- ROOT system --- @@ -40,7 +36,7 @@ public: virtual void SetShowerProfileCuts(Float_t, Float_t, Float_t, Float_t) {} ; virtual void SetDispersionCutOff(Float_t ) {} - ClassDef(AliPHOSPID,1) // Particle Identifier interface, version 1 + ClassDef(AliPHOSPID,1) // Particle Identifier algorithm (base class) } ; diff --git a/PHOS/AliPHOSPIDv1.cxx b/PHOS/AliPHOSPIDv1.cxx index ec95def00ab..df6fdfc1642 100644 --- a/PHOS/AliPHOSPIDv1.cxx +++ b/PHOS/AliPHOSPIDv1.cxx @@ -13,10 +13,14 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Algorithm class to identify the type of particle from the PHOS TrackSegment alone -//*-- Author : Y. Schutz SUBATECH -////////////////////////////////////////////////////////////////////////////// +// Implementation version v1 of the PHOS particle identifier +// Identification is based on information from PPSD and EMC +// +//*-- Author: Yves Schutz (SUBATECH) + // --- ROOT system --- @@ -32,26 +36,10 @@ ClassImp( AliPHOSPIDv1) - -//____________________________________________________________________________ - AliPHOSPIDv1::AliPHOSPIDv1(): fCutOnDispersion(1.5) - -{ - // ctor - -} - -//____________________________________________________________________________ - AliPHOSPIDv1::~AliPHOSPIDv1() -{ - // dtor -} - - //____________________________________________________________________________ void AliPHOSPIDv1::MakeParticles(TrackSegmentsList * trsl, RecParticlesList * rpl) { - // main function, does the job + // Makes a RecParticle out of a TrackSegment TIter next(trsl) ; AliPHOSTrackSegment * tracksegment ; @@ -112,6 +100,8 @@ void AliPHOSPIDv1::MakeParticles(TrackSegmentsList * trsl, RecParticlesList * r //____________________________________________________________________________ void AliPHOSPIDv1:: Print() { + // Print the parameters used for the particle type identification + cout << "AliPHOSPIDv1 : cuts for the particle idendification based on the shower profile " << endl << fLambda1m << " < value1 < " << fLambda1M << endl << fLambda2m << " < value2 < " << fLambda2M << endl ; @@ -121,6 +111,8 @@ void AliPHOSPIDv1:: Print() //____________________________________________________________________________ void AliPHOSPIDv1::SetShowerProfileCuts(Float_t l1m, Float_t l1M, Float_t l2m, Float_t l2M) { + // Modifies the parameters used for the particle type identification + fLambda1m = l1m ; fLambda1M = l1M ; fLambda2m = l2m ; diff --git a/PHOS/AliPHOSPIDv1.h b/PHOS/AliPHOSPIDv1.h index e983074b358..d8be9467450 100644 --- a/PHOS/AliPHOSPIDv1.h +++ b/PHOS/AliPHOSPIDv1.h @@ -5,13 +5,12 @@ /* $Id$ */ -/////////////////////////////////////////////////// -// Particle Identifier class for PHOS // -// Version SUBATECH // -// Author Yves Schutz // -// comment: identify the type of particle // -// PHOS SubTrack alone // -/////////////////////////////////////////////////// + +//_________________________________________________________________________ +// Implementation version v1 of the PHOS particle identifier +// Identification is based on information from PPSD and EMC +// +//*-- Author: Yves Schutz (SUBATECH) // --- ROOT system --- @@ -25,8 +24,8 @@ class AliPHOSPIDv1 : public AliPHOSPID { public: - AliPHOSPIDv1() ; - virtual ~ AliPHOSPIDv1() ; // dtor + AliPHOSPIDv1(): fCutOnDispersion(1.5){} + virtual ~ AliPHOSPIDv1(){} ; // dtor virtual void MakeParticles(TrackSegmentsList * trsl, RecParticlesList * rpl ) ; // does the job void Print() ; @@ -36,14 +35,13 @@ public: private: // cuts on the shower profile - Float_t fLambda1m ; // minimum value for first elips axis - Float_t fLambda1M ; // maximum value for first elips axis - Float_t fLambda2m ; // minimum value for second elips axis - Float_t fLambda2M ; // maximum value for second elips axis - + Float_t fLambda1m ; // minimum value for first elips axis + Float_t fLambda1M ; // maximum value for first elips axis + Float_t fLambda2m ; // minimum value for second elips axis + Float_t fLambda2M ; // maximum value for second elips axis Float_t fCutOnDispersion ; // cut on the shower dispersion to distinguish hadronic from EM showers - ClassDef( AliPHOSPIDv1,1) // particle identifier implementation , version 1 + ClassDef( AliPHOSPIDv1,1) // Particle identifier implementation version 1 }; diff --git a/PHOS/AliPHOSPpsdRecPoint.cxx b/PHOS/AliPHOSPpsdRecPoint.cxx index a904ec4e724..97afc032c28 100644 --- a/PHOS/AliPHOSPpsdRecPoint.cxx +++ b/PHOS/AliPHOSPpsdRecPoint.cxx @@ -13,17 +13,21 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// RecPoint in the PHOS PPSD: a list of AliPHOSDigit's -//*-- Author : Yves Schutz SUBATECH -////////////////////////////////////////////////////////////////////////////// +// A RecPoint (cluster) in the PPSD +// A PPSD RecPoint ends up to be a single digit +// +//*-- Yves Schutz (SUBATECH) // --- ROOT system --- + #include "TPad.h" + // --- Standard library --- #include -#include // --- AliRoot header files --- @@ -36,18 +40,14 @@ ClassImp(AliPHOSPpsdRecPoint) //____________________________________________________________________________ AliPHOSPpsdRecPoint::AliPHOSPpsdRecPoint(void) { + // ctor + fMulDigit = 0 ; AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ; fDelta = geom->GetCrystalSize(0) ; fLocPos.SetX(1000000.) ; //Local position should be evaluated } -//____________________________________________________________________________ -AliPHOSPpsdRecPoint::~AliPHOSPpsdRecPoint(void) // dtor -{ - //dtor -} - //____________________________________________________________________________ void AliPHOSPpsdRecPoint::AddDigit(AliDigitNew & digit, Float_t Energy) { @@ -76,12 +76,11 @@ void AliPHOSPpsdRecPoint::AddDigit(AliDigitNew & digit, Float_t Energy) fAmp += Energy ; } - - - //____________________________________________________________________________ Int_t AliPHOSPpsdRecPoint::Compare(TObject * obj) { + // Compares according to the position + Int_t rv ; AliPHOSPpsdRecPoint * clu = (AliPHOSPpsdRecPoint *)obj ; @@ -154,8 +153,10 @@ Int_t AliPHOSPpsdRecPoint::Compare(TObject * obj) } //____________________________________________________________________________ -void AliPHOSPpsdRecPoint::GetLocalPosition(TVector3 &LPos){ - +void AliPHOSPpsdRecPoint::GetLocalPosition(TVector3 &LPos) +{ + // Calculates the local position in the PHOS-PPSD-module corrdinates + if( fLocPos.X() < 1000000.) { //allready evaluated LPos = fLocPos ; return ; @@ -216,32 +217,35 @@ Bool_t AliPHOSPpsdRecPoint::GetUp() //______________________________________________________________________________ void AliPHOSPpsdRecPoint::Paint(Option_t *) { -//*-*-*-*-*-*-*-*-*-*-*Paint this ALiRecPoint as a TMarker with its current attributes*-*-*-*-*-*-* -//*-* ============================================= - TVector3 pos(0.,0.,0.) ; - GetLocalPosition(pos) ; - Coord_t x = pos.X() ; - Coord_t y = pos.Z() ; - Color_t markercolor = 1 ; - Size_t markersize = 1. ; - Style_t markerstyle = 2 ; - if (GetUp()) - markerstyle = 3 ; - - if (!gPad->IsBatch()) { - gVirtualX->SetMarkerColor(markercolor); - gVirtualX->SetMarkerSize (markersize); - gVirtualX->SetMarkerStyle(markerstyle); - } - gPad->SetAttMarkerPS(markercolor,markerstyle,markersize); - gPad->PaintPolyMarker(1,&x,&y,""); - - + //*-*-*-*-*-*-*-*-*-*-*Paint this ALiRecPoint as a TMarker with its current attributes*-*-*-*-*-*-* + //*-* ============================================= + + TVector3 pos(0.,0.,0.) ; + GetLocalPosition(pos) ; + Coord_t x = pos.X() ; + Coord_t y = pos.Z() ; + Color_t markercolor = 1 ; + Size_t markersize = 1. ; + Style_t markerstyle = 2 ; + if (GetUp()) + markerstyle = 3 ; + + if (!gPad->IsBatch()) { + gVirtualX->SetMarkerColor(markercolor); + gVirtualX->SetMarkerSize (markersize); + gVirtualX->SetMarkerStyle(markerstyle); + } + gPad->SetAttMarkerPS(markercolor,markerstyle,markersize); + gPad->PaintPolyMarker(1,&x,&y,""); + + } //____________________________________________________________________________ void AliPHOSPpsdRecPoint::Print(Option_t * option) { + // Print the digits information + cout << "AliPHOSPpsdRecPoint: " << endl ; AliPHOSDigit * digit ; @@ -267,35 +271,3 @@ void AliPHOSPpsdRecPoint::Print(Option_t * option) } -// //____________________________________________________________________________ -// AliPHOSPpsdRecPoint& AliPHOSPpsdRecPoint::operator = (AliPHOSPpsdRecPoint Clu) -// { -// int* DL = Clu.GetDigitsList() ; - -// if(fDigitsList) -// delete fDigitsList ; - -// AliPHOSDigit * digit ; - -// Int_t iDigit; - -// for(iDigit=0; iDigitGetPrimariesEmc(emcnumber) ; + + Int_t ppsdlnumber = 0 ; + Int_t * ppsdllist = fPHOSTrackSegment->GetPrimariesPpsdLow(ppsdlnumber) ; + + Int_t ppsdunumber = 0 ; + Int_t * ppsdulist = fPHOSTrackSegment->GetPrimariesPpsdUp(ppsdunumber) ; + + number = emcnumber + ppsdlnumber + ppsdunumber ; + Int_t * list = new Int_t[number] ; + + Int_t index ; + for ( index = 0 ; index < emcnumber ; index++) + list[index] = emclist[index] ; + + Int_t jndex ; + for ( jndex = 0 ; jndex < ppsdlnumber ; jndex++) { + assert(index < number) ; + list[index] = ppsdllist[jndex] ; + index++ ; + } + + for ( jndex = 0 ; jndex < ppsdunumber ; jndex++) { + assert(index < number) ; + list[index] = ppsdulist[jndex] ; + index++ ; + } + + cout << "passed 6 " << endl; + + delete emclist ; + delete ppsdllist ; + delete ppsdulist ; + + return list ; +} diff --git a/PHOS/AliPHOSRecParticle.h b/PHOS/AliPHOSRecParticle.h index eb0ae1c0ba6..ab35b5a6e6b 100644 --- a/PHOS/AliPHOSRecParticle.h +++ b/PHOS/AliPHOSRecParticle.h @@ -5,12 +5,11 @@ /* $Id$ */ -//////////////////////////////////////////////// -// A Reconstructed Particle in PHOS // -// Yves Schutz SUBATECH // -// To become a general class of AliRoot ? // -// // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// A Reconstructed Particle in PHOS +// To become a general class of AliRoot ? +// +//*-- Author: Yves Schutz (SUBATECH) // --- ROOT system --- @@ -34,13 +33,13 @@ public: virtual ~AliPHOSRecParticle() ; // dtor AliPHOSTrackSegment * GetPHOSTrackSegment() const { return fPHOSTrackSegment ; } + virtual Int_t * GetPrimaries(Int_t & number) ; private: AliPHOSTrackSegment * fPHOSTrackSegment ; // pointer to the associated track segment in PHOS - ClassDef(AliPHOSRecParticle,1) // Reconstructed Particle, version 1 - + ClassDef(AliPHOSRecParticle,1) // Reconstructed Particle }; #endif // AliPHOSRECPARTICLE_H diff --git a/PHOS/AliPHOSRecPoint.cxx b/PHOS/AliPHOSRecPoint.cxx index 98229f480a1..f5e0168a909 100644 --- a/PHOS/AliPHOSRecPoint.cxx +++ b/PHOS/AliPHOSRecPoint.cxx @@ -13,10 +13,12 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// PHOSRecPoint base class deriving from AliRecPoint -//*-- Author : Gines MARTINEZ SUBATECH -////////////////////////////////////////////////////////////////////////////// +// Base Class for PHOS Reconstructed Points +// +//*-- Author: Gines Martinez (SUBATECH) // --- ROOT system --- #include "TPad.h" @@ -40,35 +42,30 @@ ClassImp(AliPHOSRecPoint) AliPHOSRecPoint::AliPHOSRecPoint() : AliRecPoint() { + // ctor + fGeom = AliPHOSGeometry::GetInstance() ; fPHOSMod = 0; } -//____________________________________________________________________________ -AliPHOSRecPoint::~AliPHOSRecPoint() -{ - // dtor -} - //____________________________________________________________________________ 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. - // - - TVector3 pos(0.,0.,0.) ; - GetLocalPosition( pos) ; - Float_t x = pos.X() ; - Float_t y = pos.Z() ; - const Int_t kMaxDiff = 10; - Int_t pxm = gPad->XtoAbsPixel(x); - Int_t pym = gPad->YtoAbsPixel(y); - Int_t dist = (px-pxm)*(px-pxm) + (py-pym)*(py-pym); - - if (dist > kMaxDiff) return 9999; - return dist; + // 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) ; + Float_t x = pos.X() ; + Float_t y = pos.Z() ; + const Int_t kMaxDiff = 10; + Int_t pxm = gPad->XtoAbsPixel(x); + Int_t pym = gPad->YtoAbsPixel(y); + Int_t dist = (px-pxm)*(px-pxm) + (py-pym)*(py-pym); + + if (dist > kMaxDiff) return 9999; + return dist; } //___________________________________________________________________________ @@ -87,76 +84,77 @@ void AliPHOSRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) // // 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; - static TGraph * digitgraph = 0 ; - static TPaveText* clustertext = 0 ; - - if (!gPad->IsEditable()) return; - - switch (event) { - - - case kButton1Down:{ - AliPHOSDigit * digit ; - AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ; - Int_t iDigit; - Int_t relid[4] ; - Float_t xi[fMulDigit] ; - Float_t zi[fMulDigit] ; - - for(iDigit=0; iDigitAbsToRelNumbering(digit->GetId(), relid) ; - phosgeom->RelPosInModule(relid, xi[iDigit], zi[iDigit]) ; - } - - if (!digitgraph) { - digitgraph = new TGraph(fMulDigit,xi,zi); - digitgraph-> SetMarkerStyle(5) ; - digitgraph-> SetMarkerSize(1.) ; - digitgraph-> SetMarkerColor(1) ; - digitgraph-> Draw("P") ; - } - if (!clustertext) { + static TGraph * digitgraph = 0 ; + static TPaveText* clustertext = 0 ; + + if (!gPad->IsEditable()) return; - TVector3 pos(0.,0.,0.) ; - GetLocalPosition(pos) ; - clustertext = new TPaveText(pos.X()-10,pos.Z()+10,pos.X()+50,pos.Z()+35,"") ; - Text_t line1[40] ; - Text_t line2[40] ; - sprintf(line1,"Energy=%1.2f GeV",GetEnergy()) ; - sprintf(line2,"%d Digits",GetDigitsMultiplicity()) ; - clustertext ->AddText(line1) ; - clustertext ->AddText(line2) ; - clustertext ->Draw(""); - } - gPad->Update() ; - Print() ; + switch (event) { + + + case kButton1Down:{ + AliPHOSDigit * digit ; + AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ; + Int_t iDigit; + Int_t relid[4] ; + Float_t xi[fMulDigit] ; + Float_t zi[fMulDigit] ; + + for(iDigit=0; iDigitAbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->RelPosInModule(relid, xi[iDigit], zi[iDigit]) ; + } + + if (!digitgraph) { + digitgraph = new TGraph(fMulDigit,xi,zi); + digitgraph-> SetMarkerStyle(5) ; + digitgraph-> SetMarkerSize(1.) ; + digitgraph-> SetMarkerColor(1) ; + digitgraph-> Draw("P") ; + } + if (!clustertext) { + + TVector3 pos(0.,0.,0.) ; + GetLocalPosition(pos) ; + clustertext = new TPaveText(pos.X()-10,pos.Z()+10,pos.X()+50,pos.Z()+35,"") ; + Text_t line1[40] ; + Text_t line2[40] ; + sprintf(line1,"Energy=%1.2f GeV",GetEnergy()) ; + sprintf(line2,"%d Digits",GetDigitsMultiplicity()) ; + clustertext ->AddText(line1) ; + clustertext ->AddText(line2) ; + clustertext ->Draw(""); + } + gPad->Update() ; + Print() ; + } + + break; + + case kButton1Up: + if (digitgraph) { + delete digitgraph ; + digitgraph = 0 ; + } + if (clustertext) { + delete clustertext ; + clustertext = 0 ; + } + + break; + } - - break; - - case kButton1Up: - if (digitgraph) { - delete digitgraph ; - digitgraph = 0 ; - } - if (clustertext) { - delete clustertext ; - clustertext = 0 ; - } - - break; - - } } //____________________________________________________________________________ Int_t AliPHOSRecPoint::GetPHOSMod() -{ +{ + // Returns the PHOS module in which the RecPoint is found + if(fPHOSMod > 0) return fPHOSMod ; @@ -172,11 +170,13 @@ Int_t AliPHOSRecPoint::GetPHOSMod() } //______________________________________________________________________________ -void AliPHOSRecPoint::GetPrimaries(Int_t & number, Int_t * list) +Int_t * AliPHOSRecPoint::GetPrimaries(Int_t & number) { + // Constructs the list of primary particles which have contributed to this RecPoint + AliPHOSDigit * digit ; Int_t index ; - Int_t maxcounter = 3 ; + Int_t maxcounter = 10 ; Int_t counter = 0 ; Int_t * tempo = new Int_t[maxcounter] ; @@ -203,39 +203,36 @@ void AliPHOSRecPoint::GetPrimaries(Int_t & number, Int_t * list) break ; } } // end of check - if ( !already) { // store it - tempo[counter] = newprimary ; - counter++ ; + if ( !already) { // store it + tempo[counter] = newprimary ; + counter++ ; } // store it } // all primaries in digit delete newprimaryarray ; } // all digits number = counter ; - for ( index = 0 ; index < number ; index ++ ) - list[index] = tempo[index] ; - - delete tempo ; + return tempo ; } //______________________________________________________________________________ void AliPHOSRecPoint::Paint(Option_t *) { -// Paint this ALiRecPoint as a TMarker with its current attributes - - TVector3 pos(0.,0.,0.) ; - GetLocalPosition(pos) ; - Coord_t x = pos.X() ; - Coord_t y = pos.Z() ; - Color_t markercolor = 1 ; - Size_t markersize = 1. ; - Style_t markerstyle = 5 ; - - if (!gPad->IsBatch()) { - gVirtualX->SetMarkerColor(markercolor) ; - gVirtualX->SetMarkerSize (markersize) ; - gVirtualX->SetMarkerStyle(markerstyle) ; - } - gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ; - gPad->PaintPolyMarker(1,&x,&y,"") ; + // Paint this ALiRecPoint as a TMarker with its current attributes + + TVector3 pos(0.,0.,0.) ; + GetLocalPosition(pos) ; + Coord_t x = pos.X() ; + Coord_t y = pos.Z() ; + Color_t markercolor = 1 ; + Size_t markersize = 1. ; + Style_t markerstyle = 5 ; + + if (!gPad->IsBatch()) { + gVirtualX->SetMarkerColor(markercolor) ; + gVirtualX->SetMarkerSize (markersize) ; + gVirtualX->SetMarkerStyle(markerstyle) ; + } + gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ; + gPad->PaintPolyMarker(1,&x,&y,"") ; } diff --git a/PHOS/AliPHOSRecPoint.h b/PHOS/AliPHOSRecPoint.h index 21c8b09e7ac..0ec32112a10 100644 --- a/PHOS/AliPHOSRecPoint.h +++ b/PHOS/AliPHOSRecPoint.h @@ -3,14 +3,10 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -//////////////////////////////////////////////// -// Base class for Reconstructed Points // -// in PHOS and PPSD // -// // -// Author Gines MARTINEZ SUBATECH // -// // -// // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// Base Class for PHOS Reconstructed Points +// +//*-- Author: Gines Martinez (SUBATECH) // --- ROOT system --- @@ -26,19 +22,18 @@ #include "AliRecPoint.h" - class AliPHOSRecPoint : public AliRecPoint { public: AliPHOSRecPoint() ; // ctor - virtual ~AliPHOSRecPoint() ; // dtor + virtual ~AliPHOSRecPoint(){} // dtor virtual void AddDigit(AliDigitNew & digit, Float_t Energy) = 0 ; 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) ; virtual Int_t GetPHOSMod(void) ; - virtual void GetPrimaries(Int_t & number, Int_t * list) ; + virtual Int_t * GetPrimaries(Int_t & number) ; virtual Bool_t IsEmc(void){return kTRUE ;} virtual void Paint(Option_t * option=""); virtual void Print(Option_t * opt = "void") {} @@ -48,9 +43,9 @@ public: protected: - Int_t fPHOSMod ; + Int_t fPHOSMod ; // PHOS Module number in which the RecPoint is found - ClassDef(AliPHOSRecPoint,1) + ClassDef(AliPHOSRecPoint,1) // RecPoint for PHOS (Base Class) }; diff --git a/PHOS/AliPHOSReconstructioner.cxx b/PHOS/AliPHOSReconstructioner.cxx index 75e809b4893..b12b1c84790 100644 --- a/PHOS/AliPHOSReconstructioner.cxx +++ b/PHOS/AliPHOSReconstructioner.cxx @@ -13,10 +13,15 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// A brief description of the class -//*-- Author : Gines MARTINEZ SUBATECH -////////////////////////////////////////////////////////////////////////////// +// Algorithm class for the reconstruction: clusterizer +// track segment maker +// particle identifier +// +//*-- Author: Gines Martinez & Yves Schutz (SUBATECH) + // --- ROOT system --- @@ -31,28 +36,18 @@ ClassImp(AliPHOSReconstructioner) - -//____________________________________________________________________________ -AliPHOSReconstructioner::AliPHOSReconstructioner() -{ - // ctor -} - //____________________________________________________________________________ AliPHOSReconstructioner::AliPHOSReconstructioner(AliPHOSClusterizer * Clusterizer, AliPHOSTrackSegmentMaker * Tracker, AliPHOSPID * Pid) { + // ctor + fClusterizer = Clusterizer ; fTrackSegmentMaker = Tracker ; fPID = Pid ; } -//____________________________________________________________________________ -AliPHOSReconstructioner::~AliPHOSReconstructioner() -{ - // dtor -} //____________________________________________________________________________ void AliPHOSReconstructioner::Init(AliPHOSClusterizer * Clusterizer, @@ -64,19 +59,20 @@ AliPHOSReconstructioner::~AliPHOSReconstructioner() fPID = Pid ; } - - //____________________________________________________________________________ void AliPHOSReconstructioner::Make(TClonesArray * dl, RecPointsList * emccl, RecPointsList * ppsdl, TrackSegmentsList * trsl, RecParticlesList * rpl) { + // Launches the Reconstruction process in the sequence: Make the reconstructed poins (clusterize) + // Make the track segments + // Make the reconstructed particles - cout << "Clusterizing" << endl; + cout << "Start making reconstructed points (clusterizing)" << endl; fClusterizer->MakeClusters(dl, emccl, ppsdl); - cout << "Segment Track Maker" << endl; + cout << "Start making track segments" << endl; fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, trsl) ; - cout << "Particle Maker" << endl; + cout << "Start making reconstructed particles" << endl; fPID->MakeParticles(trsl, rpl) ; } diff --git a/PHOS/AliPHOSReconstructioner.h b/PHOS/AliPHOSReconstructioner.h index d86019759d4..217687a6a52 100644 --- a/PHOS/AliPHOSReconstructioner.h +++ b/PHOS/AliPHOSReconstructioner.h @@ -5,16 +5,12 @@ /* $Id$ */ -//////////////////////////////////////////////// -// Algorithme class for the reconstruction // -// // -// Author Gines MARTINEZ SUBATECH // -// // -// january 2000: // -// added Particle identifier (YS) // -// // -// // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// Algorithm class for the reconstruction: clusterizer +// track segment maker +// particle identifier +// +//*-- Author: Gines Martinez & Yves Schutz (SUBATECH) // --- ROOT system --- @@ -32,10 +28,10 @@ class AliPHOSReconstructioner : public TObject { public: - AliPHOSReconstructioner(); //ctor + AliPHOSReconstructioner(){} //ctor AliPHOSReconstructioner(AliPHOSClusterizer * Clusterizer, AliPHOSTrackSegmentMaker * Tracker, AliPHOSPID * Identifier); //ctor - ~AliPHOSReconstructioner(); // dtor + ~AliPHOSReconstructioner(){} // dtor AliPHOSClusterizer * GetClusterizer() { return fClusterizer ; } void Init(AliPHOSClusterizer * Clusterizer, AliPHOSTrackSegmentMaker * Tracker, @@ -50,7 +46,7 @@ private: AliPHOSTrackSegmentMaker * fTrackSegmentMaker ; // Method for track segments finding AliPHOSPID * fPID ; // Method for identifying the type of particle - ClassDef(AliPHOSReconstructioner,1) // Reconstruction interface , version 1 + ClassDef(AliPHOSReconstructioner,1) // Reconstruction algorithm class (Base Class) }; diff --git a/PHOS/AliPHOSTrackSegment.cxx b/PHOS/AliPHOSTrackSegment.cxx index 734e1d06769..860fdc47d7e 100644 --- a/PHOS/AliPHOSTrackSegment.cxx +++ b/PHOS/AliPHOSTrackSegment.cxx @@ -13,10 +13,15 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// class of PHOS Sub Track -//*-- Author : Dmitri Peressounko RRC KI -////////////////////////////////////////////////////////////////////////////// +// Track segment in PHOS +// Can be : 1 EmcRecPoint +// 1 EmcRecPoint + 1 PPSD +// 1 EmcRecPoint + 1 PPSD + 1 PPSD +// +//*-- Author: Dmitri Peressounko (RRC KI & SUBATECH) // --- ROOT system --- @@ -37,7 +42,9 @@ ClassImp(AliPHOSTrackSegment) //____________________________________________________________________________ AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , AliPHOSPpsdRecPoint * ppsdRP1, AliPHOSPpsdRecPoint * ppsdRP2 ) -{ +{ + // ctor + if( emc ) fEmcRecPoint = emc ; @@ -52,35 +59,32 @@ AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , AliPHOSPpsd //____________________________________________________________________________ AliPHOSTrackSegment::AliPHOSTrackSegment( const AliPHOSTrackSegment & ts) { + // Copy ctor + ( (AliPHOSTrackSegment &)ts ).Copy(*this) ; } -//____________________________________________________________________________ -AliPHOSTrackSegment::~AliPHOSTrackSegment() // dtor -{ -// fEmcRecPoint.Delete() ; Not Owners !!! -// fPpsdUp.Delete() ; -// fPpsdLow.Delete() ; -} //____________________________________________________________________________ void AliPHOSTrackSegment::Copy(TObject & obj) { + // Copy of a track segment into another track segment + TObject::Copy(obj) ; - ( (AliPHOSTrackSegment &)obj ).fEmcRecPoint = fEmcRecPoint ; - ( (AliPHOSTrackSegment &)obj ).fPpsdLow = fPpsdLow ; - ( (AliPHOSTrackSegment &)obj ).fPpsdUp = fPpsdUp ; + ( (AliPHOSTrackSegment &)obj ).fEmcRecPointId = fEmcRecPointId ; + ( (AliPHOSTrackSegment &)obj ).fPpsdLowId = fPpsdLowId ; + ( (AliPHOSTrackSegment &)obj ).fPpsdUpId = fPpsdUpId ; } //____________________________________________________________________________ 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. - // + // 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() ; @@ -112,7 +116,7 @@ Int_t AliPHOSTrackSegment::DistancetoPrimitive(Int_t px, Int_t py) void AliPHOSTrackSegment::Draw(Option_t *option) { // Draw this AliPHOSTrackSegment with its current attribute - + AppendPad(option); } @@ -124,48 +128,48 @@ void AliPHOSTrackSegment::ExecuteEvent(Int_t event, Int_t px, Int_t py) // // If Left button is clicked on AliPHOSRecPoint, the digits are switched on // and switched off when the mouse button is released. - // - static TPaveText* textTS = 0 ; - - if (!gPad->IsEditable()) - return; - - switch (event) { - - case kButton1Down:{ + + static TPaveText* textTS = 0 ; + + if (!gPad->IsEditable()) + return; + + switch (event) { - if (!textTS) { + case kButton1Down:{ + + if (!textTS) { + + TVector3 pos(0.,0.,0.) ; + fEmcRecPoint->GetLocalPosition(pos) ; + textTS = new TPaveText(pos.X()-10,pos.Z()+10,pos.X()+5,pos.Z()+15,"") ; + Text_t line1[40] ; + sprintf(line1,"See RecParticle for ID") ; + textTS ->AddText(line1) ; + textTS ->Draw(""); + gPad->Update() ; + } + } + + break; - TVector3 pos(0.,0.,0.) ; - fEmcRecPoint->GetLocalPosition(pos) ; - textTS = new TPaveText(pos.X()-10,pos.Z()+10,pos.X()+5,pos.Z()+15,"") ; - Text_t line1[40] ; - sprintf(line1,"See RecParticle for ID") ; - textTS ->AddText(line1) ; - textTS ->Draw(""); - gPad->Update() ; - } - } - - break; - - case kButton1Up: - if (textTS) { - delete textTS ; - textTS = 0 ; - } - break; - } + case kButton1Up: + if (textTS) { + delete textTS ; + textTS = 0 ; + } + break; + } } - //____________________________________________________________________________ Float_t AliPHOSTrackSegment::GetDistanceInPHOSPlane() { - + // Calculates the distance between the EMC RecPoint and PPSD RecPoint + TVector3 vecEmc ; fEmcRecPoint->GetLocalPosition(vecEmc) ; - + TVector3 vecPpsd ; if( fPpsdLow->GetMultiplicity() ) fPpsdLow->GetLocalPosition(vecPpsd) ; @@ -181,14 +185,22 @@ Float_t AliPHOSTrackSegment::GetDistanceInPHOSPlane() //____________________________________________________________________________ TVector3 AliPHOSTrackSegment::GetMomentumDirection() -{ - TVector3 dir, tempo ; +{ + // Calculates the momentum direction: + // 1. if only a EMC RecPoint, direction is given by IP and this RecPoint + // 2. if a EMC RecPoint and one PPSD RecPoint, direction is given by the line through the 2 recpoints + // 3. if a EMC RecPoint and two PPSD RecPoints, dirrection is given by the average line through + // the 2 pairs of recpoints + // However because of the poor position resolution of PPSD the direction is always taken as if we were + // in case 1. + + TVector3 dir(0,0,0) ; TMatrix mdummy ; TVector3 posEmc ; fEmcRecPoint->GetGlobalPosition(posEmc, mdummy) ; - // need to correct here for the depth of the shower start point (TDR p 127) ? + // Correction for the depth of the shower starting point (TDR p 127) Float_t energy = fEmcRecPoint->GetEnergy() ; Float_t para = 0.925 ; @@ -202,115 +214,170 @@ TVector3 AliPHOSTrackSegment::GetMomentumDirection() Float_t incidencephi = TMath::ATan(localpos.X() / radius) ; Float_t incidencetheta = TMath::ATan(localpos.Z() / radius) ; - Float_t depthx = - ( para * TMath::Log(energy) + parb ) * TMath::Sin(incidencephi) ; - Float_t depthz = - ( para * TMath::Log(energy) + parb ) * TMath::Sin(incidencetheta) ; + Float_t depthx = ( para * TMath::Log(energy) + parb ) * TMath::Sin(incidencephi) ; + Float_t depthz = ( para * TMath::Log(energy) + parb ) * TMath::Sin(incidencetheta) ; - TVector3 posPpsdl ; - TVector3 posPpsdup ; + localpos.SetX(localpos.X() - depthx ) ; + localpos.SetZ(localpos.Z() - depthz ) ; -// if( fPpsdLow ){ -// fPpsdLow->GetGlobalPosition(posPpsdl, mdummy) ; -// if( !fPpsdUp ) { // draw line trough 2 points -// tempo = posEmc - posPpsdl; -// } + TVector3 emcglobalpos ; + TMatrix dummy ; -// 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() + depthx ) ; // assumes that a neutral comes from the vertex - dir.SetY( tempo.Y() ) ; - dir.SetZ( -tempo.Z() - depthz ) ; + fEmcRecPoint->GetGlobalPosition(emcglobalpos, dummy) ; + + emcglobalpos.SetX( emcglobalpos.X() - depthx ) ; + emcglobalpos.SetZ( emcglobalpos.Z() - depthz ) ; + // The following commeneted code becomes valid once the PPSD provides + // a reasonable position resolution, at least as good as EMC ! + +// TVector3 ppsdlglobalpos ; +// TVector3 ppsduglobalpos ; + +// if( fPpsdLow ){ // certainly a photon that has concerted + +// fPpsdLow->GetGlobalPosition(ppsdlglobalpos, mdummy) ; +// dir = emcglobalpos - ppsdlglobalpos ; + +// if( fPpsdUp ){ // nop looks like a charged + +// fPpsdUp->GetGlobalPosition(ppsduglobalpos, mdummy) ; +// dir = ( dir + emcglobalpos - ppsduglobalpos ) * 0.5 ; +// } +// } + +// else { // looks like a neutral + + dir = emcglobalpos ; +// } + + dir.SetZ( -dir.Z() ) ; // why ? dir.SetMag(1.) ; + return dir ; } +//____________________________________________________________________________ +Int_t * AliPHOSTrackSegment::GetPrimariesEmc(Int_t & number) +{ + // Retrieves the primary particle(s) at the origin of the EMC RecPoint + + Int_t * rv = 0 ; + number = 0 ; + if ( fEmcRecPoint ) + rv = fEmcRecPoint->GetPrimaries(number) ; + + return rv ; +} + +//____________________________________________________________________________ +Int_t * AliPHOSTrackSegment::GetPrimariesPpsdLow(Int_t & number) +{ + // Retrieves the primary particle(s) at the origin of the lower PPSD RecPoint + + Int_t * rv = 0 ; + number = 0 ; + if ( fPpsdLow ) + rv = fPpsdLow->GetPrimaries(number) ; + + return rv ; +} + +//____________________________________________________________________________ +Int_t * AliPHOSTrackSegment::GetPrimariesPpsdUp(Int_t & number) +{ + // Retrieves the primary particle(s) at the origin of the upper PPSD RecPoint + + Int_t * rv = 0 ; + number = 0 ; + if ( fPpsdUp ) + rv = fPpsdUp->GetPrimaries(number) ; + + return rv ; +} //____________________________________________________________________________ void AliPHOSTrackSegment::GetPosition( TVector3 & pos ) { - // Returns positions of hits + // Returns position of the EMC RecPoint + TMatrix dummy ; fEmcRecPoint->GetGlobalPosition(pos, dummy) ; } + //______________________________________________________________________________ void AliPHOSTrackSegment::Paint(Option_t *) { - //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() ; - - 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->SetMarkerSize (markersize) ; - gVirtualX->SetMarkerStyle(markerstyle) ; - } - gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ; - gPad->PaintPolyMarker(1, &xemc, &yemc, "") ; - - if (xppsdl != 999. && yppsdl != 999. ) { + // Paint this ALiPHOSTrackSegment as a TMarker with its current attributes - 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. ) { + TVector3 posemc(999., 999., 999.) ; + TVector3 posppsdl(999., 999., 999.) ; + TVector3 posppsdu(999., 999., 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, "") ; + 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() ; + + 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->SetMarkerSize (markersize) ; + gVirtualX->SetMarkerStyle(markerstyle) ; + } + gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ; + 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, "") ; + } } - //____________________________________________________________________________ void AliPHOSTrackSegment::Print() { + // Print all information on this track Segment + cout << "--------AliPHOSTrackSegment-------- "<GetPHOSMod(); } TVector3 GetMomentumDirection() ; // Returns the momentum direction void GetPosition( TVector3 & pos ) ; // Returns positions of hit + Int_t * GetPrimariesEmc(Int_t & number) ; + Int_t * GetPrimariesPpsdLow(Int_t & number) ; + Int_t * GetPrimariesPpsdUp(Int_t & number) ; AliPHOSEmcRecPoint * GetEmcRecPoint() const { return fEmcRecPoint ; } AliPHOSPpsdRecPoint * GetPpsdLow() const { return fPpsdLow ; } AliPHOSPpsdRecPoint * GetPpsdUp() const { return fPpsdUp ; } @@ -56,12 +57,14 @@ public: private: - AliPHOSEmcRecPoint * fEmcRecPoint ; - AliPHOSPpsdRecPoint * fPpsdLow ; - AliPHOSPpsdRecPoint * fPpsdUp ; - + AliPHOSEmcRecPoint * fEmcRecPoint ; //! The EMC reconstructed point + AliPHOSPpsdRecPoint * fPpsdLow ; //! The PPSD reconstructed point from the lower layer + AliPHOSPpsdRecPoint * fPpsdUp ; //! The PPSD reconstructed point from the upper layer + Int_t fEmcRecPointId ; // The EMC reconstructed point Id in the list + Int_t fPpsdLowId ; // The PPSD reconstructed point from the lower layer Id in the list + Int_t fPpsdUpId ; // The PPSD reconstructed point from the upper layer Id in the list - ClassDef(AliPHOSTrackSegment,1) // description , version 1 + ClassDef(AliPHOSTrackSegment,1) // Track segment in PHOS }; diff --git a/PHOS/AliPHOSTrackSegmentMaker.cxx b/PHOS/AliPHOSTrackSegmentMaker.cxx index 21a404df812..7715aad11b4 100644 --- a/PHOS/AliPHOSTrackSegmentMaker.cxx +++ b/PHOS/AliPHOSTrackSegmentMaker.cxx @@ -13,10 +13,15 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// A brief description of the class -//*-- Author : Yves Schutz SUBATECH -////////////////////////////////////////////////////////////////////////////// +// Algorithm Base class to construct PHOS track segments +// Associates EMC and PPSD clusters +// Unfolds the EMC cluster +// +//*-- Author: Dmitri Peressounko (RRC Ki & SUBATECH) + // --- ROOT system --- @@ -39,9 +44,9 @@ ClassImp( AliPHOSTrackSegmentMaker) //____________________________________________________________________________ - AliPHOSTrackSegmentMaker:: AliPHOSTrackSegmentMaker() // ctor + AliPHOSTrackSegmentMaker:: AliPHOSTrackSegmentMaker() : fNTrackSegments(0) { - + // ctor } diff --git a/PHOS/AliPHOSTrackSegmentMaker.h b/PHOS/AliPHOSTrackSegmentMaker.h index 21f5be0c006..ef10a124bf8 100644 --- a/PHOS/AliPHOSTrackSegmentMaker.h +++ b/PHOS/AliPHOSTrackSegmentMaker.h @@ -5,13 +5,12 @@ /* $Id$ */ -/////////////////////////////////////////////////// -// Subtrackin class for PHOS // -// Version SUBATECH // -// Author Dmitri Peressounko RRC Ki // -// comment: finds pairs of clusters EMC+PPSD // -// performs unfolding. // -/////////////////////////////////////////////////// +//_________________________________________________________________________ +// Algorithm Base class to construct PHOS track segments +// Associates EMC and PPSD clusters +// Unfolds the EMC cluster +// +//*-- Author: Dmitri Peressounko (RRC Ki & SUBATECH) // --- ROOT system --- @@ -24,7 +23,7 @@ #include "AliPHOSEmcRecPoint.h" #include "AliPHOSPpsdRecPoint.h" -typedef TObjArray TrackSegmentsList ; +typedef TClonesArray TrackSegmentsList ; class AliPHOSTrackSegmentMaker : public TObject { @@ -39,8 +38,12 @@ public: virtual void SetMaxEmcPpsdDistance(Float_t r) = 0 ; virtual void SetUnfoldFlag() = 0 ; virtual void UnsetUnfoldFlag() = 0 ; - - ClassDef( AliPHOSTrackSegmentMaker,1) // subtracking implementation , version 1 + + protected: + + Int_t fNTrackSegments ; // number of track segments found + + ClassDef( AliPHOSTrackSegmentMaker,1) // Algorithm class to make PHOS track segments (Base Class) }; diff --git a/PHOS/AliPHOSTrackSegmentMakerv1.cxx b/PHOS/AliPHOSTrackSegmentMakerv1.cxx index 520f04786fe..77c16f262d3 100644 --- a/PHOS/AliPHOSTrackSegmentMakerv1.cxx +++ b/PHOS/AliPHOSTrackSegmentMakerv1.cxx @@ -13,11 +13,15 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Algorithm class to construct track segments connection RecPoints in -// EMCA and Ppsd. Unfolds also the clusters in EMCA. -//*-- Author : D. Peressounko SUBATECH -////////////////////////////////////////////////////////////////////////////// +// Implementation version 1 of algorithm class to construct PHOS track segments +// Associates EMC and PPSD clusters +// Unfolds the EMC cluster +// +//*-- Author: Dmitri Peressounko (RRC Ki & SUBATECH) +// // --- ROOT system --- @@ -44,9 +48,10 @@ ClassImp( AliPHOSTrackSegmentMakerv1) //____________________________________________________________________________ - AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1() + AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1() : AliPHOSTrackSegmentMaker() { // ctor + fR0 = 4. ; AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ; //clusters are sorted in "rows" and "columns" of width geom->GetCrystalSize(0), @@ -59,13 +64,15 @@ ClassImp( AliPHOSTrackSegmentMakerv1) AliPHOSTrackSegmentMakerv1::~AliPHOSTrackSegmentMakerv1() { // dtor - delete fMinuit ; + + delete fMinuit ; } + //____________________________________________________________________________ Bool_t AliPHOSTrackSegmentMakerv1::FindFit(AliPHOSEmcRecPoint * emcRP, int * maxAt, Float_t * maxAtEnergy, Int_t nPar, Float_t * fitparameters) { - // Calls TMinuit for fitting cluster with several maxima + // Calls TMinuit to fit the energy distribution of a cluster with several maxima AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ; @@ -139,7 +146,7 @@ Bool_t AliPHOSTrackSegmentMakerv1::FindFit(AliPHOSEmcRecPoint * emcRP, int * ma } //____________________________________________________________________________ -void AliPHOSTrackSegmentMakerv1::FillOneModule(DigitsList * Dl, RecPointsList * emcIn, TObjArray * emcOut, +void AliPHOSTrackSegmentMakerv1::FillOneModule(DigitsList * dl, RecPointsList * emcIn, TObjArray * emcOut, RecPointsList * ppsdIn, TObjArray * ppsdOutUp, TObjArray * ppsdOutLow, Int_t & phosmod, Int_t & emcStopedAt, Int_t & ppsdStopedAt) @@ -165,7 +172,7 @@ void AliPHOSTrackSegmentMakerv1::FillOneModule(DigitsList * Dl, RecPointsList * if(nMax <= 1 ) // if cluster is very flat (no pronounced maximum) then nMax = 0 emcOut->Add(emcRecPoint) ; else if (fUnfoldFlag) { - UnfoldClusters(Dl, emcIn, emcRecPoint, nMax, maxAt, maxAtEnergy, emcOut) ; + UnfoldClusters(dl, emcIn, emcRecPoint, nMax, maxAt, maxAtEnergy, emcOut) ; emcIn->Remove(emcRecPoint); emcIn->Compress() ; nEmcUnfolded-- ; @@ -192,6 +199,8 @@ void AliPHOSTrackSegmentMakerv1::FillOneModule(DigitsList * Dl, RecPointsList * //____________________________________________________________________________ Float_t AliPHOSTrackSegmentMakerv1::GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * emcclu,AliPHOSPpsdRecPoint * PpsdClu, Bool_t &toofar) { + // Calculates the distance between the EMC RecPoint and the PPSD RecPoint + Float_t r = fR0 ; TVector3 vecEmc ; @@ -227,8 +236,8 @@ void AliPHOSTrackSegmentMakerv1::MakeLinks(TObjArray * emcRecPoints, TObjArray TObjArray * ppsdRecPointsLow, TClonesArray * linklowArray, TClonesArray *linkupArray) { - //Finds distanses (links) between all EMC and PPSD clusters, which are not further from each other than fR0 - + // Finds distances (links) between all EMC and PPSD clusters, which are not further apart from each other than fR0 + TIter nextEmc(emcRecPoints) ; Int_t iEmcClu = 0 ; @@ -314,8 +323,10 @@ void AliPHOSTrackSegmentMakerv1::MakePairs(TObjArray * emcRecPoints, TObjArray } // while nextUp nextUp.Reset(); - AliPHOSTrackSegment * subtr = new AliPHOSTrackSegment(emc, ppsdUp, ppsdLow ) ; - trsl->Add(subtr) ; +// AliPHOSTrackSegment * subtr = new AliPHOSTrackSegment(emc, ppsdUp, ppsdLow ) ; +// trsl->Add(subtr) ; + new( (*trsl)[fNTrackSegments] ) AliPHOSTrackSegment(emc, ppsdUp, ppsdLow ) ; + fNTrackSegments++ ; emcRecPoints->AddAt(nullpointer,linkLow->GetEmc()) ; ppsdRecPointsLow->AddAt(nullpointer,linkLow->GetPpsd()) ; @@ -340,9 +351,12 @@ void AliPHOSTrackSegmentMakerv1::MakePairs(TObjArray * emcRecPoints, TObjArray } } - AliPHOSTrackSegment * subtr = new AliPHOSTrackSegment(emc, ppsdUp, ppsdLow ) ; - trsl->Add(subtr) ; - +// AliPHOSTrackSegment * subtr = new AliPHOSTrackSegment(emc, ppsdUp, ppsdLow ) ; +// trsl->Add(subtr) ; + new( (*trsl)[fNTrackSegments] ) AliPHOSTrackSegment(emc, ppsdUp, ppsdLow ) ; + fNTrackSegments++ ; + + if(ppsdUp) ppsdRecPointsUp->AddAt(nullpointer,linkUp->GetPpsd()) ; } @@ -350,10 +364,10 @@ void AliPHOSTrackSegmentMakerv1::MakePairs(TObjArray * emcRecPoints, TObjArray } //____________________________________________________________________________ -void AliPHOSTrackSegmentMakerv1::MakeTrackSegments(DigitsList * DL, RecPointsList * emcl, +void AliPHOSTrackSegmentMakerv1::MakeTrackSegments(DigitsList * dl, RecPointsList * emcl, RecPointsList * ppsdl, TrackSegmentsList * trsl) { - // main function, does the job + // Makes the track segments out of the list of EMC and PPSD Recpoints and stores them in a list Int_t phosmod = 1 ; Int_t emcStopedAt = 0 ; @@ -371,7 +385,7 @@ void AliPHOSTrackSegmentMakerv1::MakeTrackSegments(DigitsList * DL, RecPointsLi while(phosmod <= geom->GetNModules() ){ - FillOneModule(DL, emcl, emcRecPoints, ppsdl, ppsdRecPointsUp, ppsdRecPointsLow, phosmod, emcStopedAt, ppsdStopedAt) ; + FillOneModule(dl, emcl, emcRecPoints, ppsdl, ppsdRecPointsUp, ppsdRecPointsLow, phosmod, emcStopedAt, ppsdStopedAt) ; MakeLinks(emcRecPoints, ppsdRecPointsUp, ppsdRecPointsLow, linklowArray, linkupArray) ; @@ -408,7 +422,9 @@ void AliPHOSTrackSegmentMakerv1::MakeTrackSegments(DigitsList * DL, RecPointsLi //____________________________________________________________________________ Double_t AliPHOSTrackSegmentMakerv1::ShowerShape(Double_t r) { -// If you change this function, change also gradiend evaluation in ChiSquare() + // Shape of the shower (see PHOS TDR) + // If you change this function, change also the gradien evaluation in ChiSquare() + 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) ) ) ; @@ -416,11 +432,12 @@ Double_t AliPHOSTrackSegmentMakerv1::ShowerShape(Double_t r) } //____________________________________________________________________________ -void AliPHOSTrackSegmentMakerv1::UnfoldClusters(DigitsList * DL, RecPointsList * emcIn, AliPHOSEmcRecPoint * iniEmc, +void AliPHOSTrackSegmentMakerv1::UnfoldClusters(DigitsList * dl, RecPointsList * emcIn, AliPHOSEmcRecPoint * iniEmc, Int_t nMax, int * maxAt, Float_t * maxAtEnergy, TObjArray * emcList) { - // fits cluster with nMax overlapping showers - + // Performs the unfolding of a cluster with nMax overlapping showers + // This is time consuming (use the (Un)SetUnfolFlag() ) + Int_t nPar = 3 * nMax ; Float_t fitparameters[nPar] ; AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ; @@ -464,7 +481,7 @@ void AliPHOSTrackSegmentMakerv1::UnfoldClusters(DigitsList * DL, RecPointsList iparam += 3 ; distance = (xDigit - xpar) * (xDigit - xpar) + (zDigit - zpar) * (zDigit - zpar) ; distance = TMath::Sqrt(distance) ; - efit[iDigit] += epar * ShowerShape(distance) ; + efit[iDigit] += epar * AliPHOSTrackSegmentMakerv1::ShowerShape(distance) ; } } @@ -485,7 +502,7 @@ void AliPHOSTrackSegmentMakerv1::UnfoldClusters(DigitsList * DL, RecPointsList geom->RelPosInModule(relid, xDigit, zDigit) ; distance = (xDigit - xpar) * (xDigit - xpar) + (zDigit - zpar) * (zDigit - zpar) ; distance = TMath::Sqrt(distance) ; - ratio = epar * ShowerShape(distance) / efit[iDigit] ; + ratio = epar * AliPHOSTrackSegmentMakerv1::ShowerShape(distance) / efit[iDigit] ; eDigit = emcEnergies[iDigit] * ratio ; emcRP->AddDigit( *digit, eDigit ) ; } @@ -498,8 +515,8 @@ void AliPHOSTrackSegmentMakerv1::UnfoldClusters(DigitsList * DL, RecPointsList //______________________________________________________________________________ void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) { - -// Number of parameters, Gradient, Chi squared, parameters, what to do + // Calculates th Chi square for the cluster unfolding minimization + // Number of parameters, Gradient, Chi squared, parameters, what to do AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ; diff --git a/PHOS/AliPHOSTrackSegmentMakerv1.h b/PHOS/AliPHOSTrackSegmentMakerv1.h index 96031c879ba..dd45e5ea14c 100644 --- a/PHOS/AliPHOSTrackSegmentMakerv1.h +++ b/PHOS/AliPHOSTrackSegmentMakerv1.h @@ -5,13 +5,12 @@ /* $Id$ */ -/////////////////////////////////////////////////// -// Track Segment Maker class for PHOS // -// Version SUBATECH // -// Author Dmitri Peressounko RRC Ki // -// comment: finds pairs of clusters EMC+PPSD // -// performs unfolding. // -/////////////////////////////////////////////////// +//_________________________________________________________________________ +// Implementation version 1 of algorithm class to construct PHOS track segments +// Associates EMC and PPSD clusters +// Unfolds the EMC cluster +// +//*-- Author: Dmitri Peressounko (RRC Ki & SUBATECH) // --- ROOT system --- @@ -55,12 +54,12 @@ public: private: - Float_t fDelta ; // parameter used for sorting - TMinuit * fMinuit ; // Minuit object needed by cluster unfolding - Float_t fR0 ; - Bool_t fUnfoldFlag ;// Directive to unfold or not the clusters in case of multiple maxima + Float_t fDelta ; // parameter used for sorting + TMinuit * fMinuit ; // Minuit object needed by cluster unfolding + Float_t fR0 ; // Maximum distance between a EMC RecPoint and a PPSD RecPoint + Bool_t fUnfoldFlag ; // Directive to unfold or not the clusters in case of multiple maxima - ClassDef( AliPHOSTrackSegmentMakerv1,1) // track segment maker implementation , version 1 + ClassDef( AliPHOSTrackSegmentMakerv1,1) // Implementation version 1 of algorithm class to make PHOS track segments }; diff --git a/PHOS/AliPHOSv0.cxx b/PHOS/AliPHOSv0.cxx index ab4eba18c73..62bfc0039cb 100644 --- a/PHOS/AliPHOSv0.cxx +++ b/PHOS/AliPHOSv0.cxx @@ -13,10 +13,14 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Manager class for PHOS version SUBATECH -//*-- Author : Y. Schutz SUBATECH -////////////////////////////////////////////////////////////////////////////// +// Implementation version v0 of PHOS Manager class +// Layout EMC + PPSD has name GPS2 +// +//*-- Author: Yves Schutz (SUBATECH) + // --- ROOT system --- @@ -46,6 +50,7 @@ ClassImp(AliPHOSv0) //____________________________________________________________________________ AliPHOSv0::AliPHOSv0() { + // ctor fNTmpHits = 0 ; fTmpHits = 0 ; } @@ -54,7 +59,8 @@ AliPHOSv0::AliPHOSv0() AliPHOSv0::AliPHOSv0(const char *name, const char *title): AliPHOS(name,title) { - + // ctor : title is used to identify the layout + // GPS2 = 5 modules (EMC + PPSD) // We use 2 arrays of hits : // // - fHits (the "normal" one), which retains the hits associated with @@ -92,7 +98,8 @@ AliPHOSv0::AliPHOSv0(const char *name, const char *title): AliPHOSv0::AliPHOSv0(AliPHOSReconstructioner * Reconstructioner, const char *name, const char *title): AliPHOS(name,title) { - + // ctor : title is used to identify the layout + // GPS2 = 5 modules (EMC + PPSD) // We use 2 arrays of hits : // // - fHits (the "normal" one), which retains the hits associated with @@ -101,6 +108,7 @@ AliPHOSv0::AliPHOSv0(AliPHOSReconstructioner * Reconstructioner, const char *nam // // - fTmpHits, which retains all the hits of the current event. It // is used for the digitization part. + fPinElectronicNoise = 0.010 ; fHits = new TClonesArray("AliPHOSHit",100) ; fDigits = new TClonesArray("AliPHOSDigit",100) ; @@ -126,6 +134,8 @@ AliPHOSv0::AliPHOSv0(AliPHOSReconstructioner * Reconstructioner, const char *nam //____________________________________________________________________________ AliPHOSv0::~AliPHOSv0() { + // dtor + fTmpHits->Delete() ; delete fTmpHits ; fTmpHits = 0 ; @@ -146,6 +156,10 @@ AliPHOSv0::~AliPHOSv0() //____________________________________________________________________________ void AliPHOSv0::AddHit(Int_t primary, Int_t Id, Float_t * hits) { + // Add a hit to the hit list. + // A PHOS hit is the sum of all hits in a single crystal + // or in a single PPSD gas cell + Int_t hitCounter ; TClonesArray <mphits = *fTmpHits ; AliPHOSHit *newHit ; @@ -188,6 +202,36 @@ void AliPHOSv0::AddHit(Int_t primary, Int_t Id, Float_t * hits) //____________________________________________________________________________ void AliPHOSv0::BuildGeometry() { + // Build the PHOS geometry for the ROOT display + //BEGIN_HTML + /* +

+ PHOS in ALICE displayed by root +

+
    +
  • All Views +

    +

    + All Views +

  • +
  • Front View +

    +

    + Front View +

  • +
  • 3D View 1 +

    +

    + 3D View 1 +

  • +
  • 3D View 2 +

    +

    + 3D View 2 +

  • +
+ */ + //END_HTML this->BuildGeometryforPHOS() ; if ( ( strcmp(fGeom->GetName(), "GPS2" ) == 0 ) ) @@ -200,7 +244,7 @@ void AliPHOSv0::BuildGeometry() //____________________________________________________________________________ void AliPHOSv0:: BuildGeometryforPHOS(void) { - // Build the PHOS geometry for the ROOT display + // Build the PHOS-EMC geometry for the ROOT display const Int_t kColorPHOS = kRed ; const Int_t kColorXTAL = kBlue ; @@ -299,8 +343,26 @@ void AliPHOSv0:: BuildGeometryforPHOS(void) //____________________________________________________________________________ void AliPHOSv0:: BuildGeometryforPPSD(void) { - // Build the PPSD geometry for the ROOT display - + // Build the PHOS-PPSD geometry for the ROOT display + //BEGIN_HTML + /* +

+ PPSD displayed by root +

+
    +
  • Zoom on PPSD: Front View +

    +

    + PPSD Front View +

  • +
  • Zoom on PPSD: Perspective View +

    +

    + PPSD Prespective View +

  • +
+ */ + //END_HTML Double_t const kRADDEG = 180.0 / kPI ; const Int_t kColorPHOS = kRed ; @@ -541,6 +603,7 @@ void AliPHOSv0:: BuildGeometryforPPSD(void) //____________________________________________________________________________ void AliPHOSv0::CreateGeometry() { + // Create the PHOS geometry for Geant AliPHOSv0 *phostmp = (AliPHOSv0*)gAlice->GetModule("PHOS") ; @@ -550,7 +613,6 @@ void AliPHOSv0::CreateGeometry() return; } - // Get pointer to the array containing media indeces Int_t *idtmed = fIdtmed->GetArray() - 699 ; @@ -591,7 +653,19 @@ void AliPHOSv0::CreateGeometry() //____________________________________________________________________________ void AliPHOSv0::CreateGeometryforPHOS() { - // Get pointer to the array containing media indeces + // Create the PHOS-EMC geometry for GEANT + //BEGIN_HTML + /* +

+ Geant3 geometry tree of PHOS-EMC in ALICE +

+

+ EMC geant tree +

+ */ + //END_HTML + + // Get pointer to the array containing media indexes Int_t *idtmed = fIdtmed->GetArray() - 699 ; // --- @@ -847,7 +921,20 @@ void AliPHOSv0::CreateGeometryforPHOS() //____________________________________________________________________________ void AliPHOSv0::CreateGeometryforPPSD() { - // Get pointer to the array containing media indeces + // Create the PHOS-PPSD geometry for GEANT + + //BEGIN_HTML + /* +

+ Geant3 geometry tree of PHOS-PPSD in ALICE +

+

+ PPSD geant tree +

+ */ + //END_HTML + + // Get pointer to the array containing media indexes Int_t *idtmed = fIdtmed->GetArray() - 699 ; // The box containing all ppsd's for one PHOS module filled with air @@ -1034,7 +1121,10 @@ void AliPHOSv0::CreateGeometryforPPSD() } //___________________________________________________________________________ -Int_t AliPHOSv0::Digitize(Float_t Energy){ +Int_t AliPHOSv0::Digitize(Float_t Energy) +{ + // Applies the energy calibration + Float_t fB = 100000000. ; Float_t fA = 0. ; Int_t chan = Int_t(fA + Energy*fB ) ; @@ -1043,8 +1133,10 @@ Int_t AliPHOSv0::Digitize(Float_t Energy){ //___________________________________________________________________________ void AliPHOSv0::FinishEvent() { -// cout << "//_____________________________________________________" << endl ; -// cout << " AliPHOSv0::FinishEvent() -- Starting digitalization" << endl ; + // Makes the digits from the sum of summed hit in a single crystal or PPSD gas cell + // Adds to the energy the electronic noise + // Keeps digits with energy above fDigitThreshold + Int_t i ; Int_t relid[4]; Int_t j ; @@ -1053,7 +1145,7 @@ void AliPHOSv0::FinishEvent() AliPHOSDigit * newdigit ; AliPHOSDigit * curdigit ; Bool_t deja = kFALSE ; - + for ( i = 0 ; i < fNTmpHits ; i++ ) { hit = (AliPHOSHit*)fTmpHits->At(i) ; newdigit = new AliPHOSDigit( hit->GetPrimary(), hit->GetId(), Digitize( hit->GetEnergy() ) ) ; @@ -1100,7 +1192,8 @@ void AliPHOSv0::FinishEvent() //____________________________________________________________________________ void AliPHOSv0::Init(void) { - + // Just prints an information message + Int_t i; printf("\n"); @@ -1119,10 +1212,8 @@ void AliPHOSv0::Init(void) //___________________________________________________________________________ void AliPHOSv0::MakeBranch(Option_t* opt) { - // - // Create a new branch in the current Root Tree - // The branch of fHits is automatically split - // + // Create new branche in the current Root Tree in the digit Tree + AliDetector::MakeBranch(opt) ; char branchname[10]; @@ -1132,54 +1223,86 @@ void AliPHOSv0::MakeBranch(Option_t* opt) if (fDigits && gAlice->TreeD() && cdD) { gAlice->TreeD()->Branch(branchname,&fDigits, fBufferSize); } - char *cdR = strstr(opt,"R"); - if (fRecParticles && gAlice->TreeR() && cdR) { - gAlice->TreeR()->Branch(branchname, &fRecParticles, fBufferSize); - } } //_____________________________________________________________________________ void AliPHOSv0::Reconstruction(AliPHOSReconstructioner * Reconstructioner) { - // reinitializes the existing RecPoint Lists and steers the reconstruction processes - + // 1. Reinitializes the existing RecPoint, TrackSegment, and RecParticles Lists and + // 2. Creates a branch in TreeR for each list + // 3. Steers the reconstruction processes + // 4. Saves the 3 lists in TreeR + // 5. Write the Tree to File + fReconstructioner = Reconstructioner ; + + char branchname[10] ; + // 1. + if (fEmcClusters) { fEmcClusters->Delete() ; delete fEmcClusters ; fEmcClusters = 0 ; } fEmcClusters= new RecPointsList("AliPHOSEmcRecPoint", 100) ; - + if ( fEmcClusters && gAlice->TreeR() ) { + sprintf(branchname,"%sERP",GetName()) ; + gAlice->TreeR()->Branch(branchname, &fEmcClusters, fBufferSize); + } + if (fPpsdClusters) { fPpsdClusters->Delete() ; delete fPpsdClusters ; fPpsdClusters = 0 ; } fPpsdClusters = new RecPointsList("AliPHOSPpsdRecPoint", 100) ; + if ( fPpsdClusters && gAlice->TreeR() ) { + sprintf(branchname,"%sPRP",GetName()) ; + gAlice->TreeR()->Branch(branchname, &fPpsdClusters, fBufferSize); + } - if (fTrackSegments) { + if (fTrackSegments) { fTrackSegments->Delete() ; delete fTrackSegments ; fTrackSegments = 0 ; } - fTrackSegments = new TrackSegmentsList(100) ; - + fTrackSegments = new TrackSegmentsList("AliPHOSTrackSegment", 100) ; + if ( fTrackSegments && gAlice->TreeR() ) { + sprintf(branchname,"%sTS",GetName()) ; + gAlice->TreeR()->Branch(branchname, &fTrackSegments, fBufferSize); + } + if (fRecParticles) { fRecParticles->Delete() ; delete fRecParticles ; fRecParticles = 0 ; } fRecParticles = new RecParticlesList("AliPHOSRecParticle", 100) ; + if ( fRecParticles && gAlice->TreeR() ) { + sprintf(branchname,"%sRP",GetName()) ; + gAlice->TreeR()->Branch(branchname, &fRecParticles, fBufferSize); + } + + // 3. fReconstructioner->Make(fDigits, fEmcClusters, fPpsdClusters, fTrackSegments, fRecParticles); + // 4. + + gAlice->TreeR()->Fill() ; + + // 5. + + gAlice->TreeR()->Write() ; + } //____________________________________________________________________________ void AliPHOSv0::StepManager(void) { + // Accumulates hits as long as the track stays in a single crystal or PPSD gas Cell + Int_t relid[4] ; // (box, layer, row, column) indices Float_t xyze[4] ; // position wrt MRS and energy deposited TLorentzVector pos ; @@ -1187,9 +1310,8 @@ void AliPHOSv0::StepManager(void) Int_t primary = gAlice->GetPrimary( gAlice->CurrentTrack() ); TString name = fGeom->GetName() ; - if ( name == "GPS2" ) { // the CPV is a PPSD - if( gMC->CurrentVolID(copy) == gMC->VolId("GCEL") ) + if( gMC->CurrentVolID(copy) == gMC->VolId("GCEL") ) // We are inside a gas cell { gMC->TrackPosition(pos) ; xyze[0] = pos[0] ; diff --git a/PHOS/AliPHOSv0.h b/PHOS/AliPHOSv0.h index 5ebc9a36e04..f41c243c072 100644 --- a/PHOS/AliPHOSv0.h +++ b/PHOS/AliPHOSv0.h @@ -3,13 +3,11 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -//////////////////////////////////////////////// -// Manager class for PHOS // -// Version SUBATECH // -// Author Y. Schutz SUBATECH // -// geometry parametrized for any // -// shape of modules // -//////////////////////////////////////////////// +//_________________________________________________________________________ +// Implementation version v0 of PHOS Manager class +// Layout EMC + PPSD has name GPS2 +// +//*-- Author: Yves Schutz (SUBATECH) // --- ROOT system --- #include "TClonesArray.h" @@ -55,19 +53,19 @@ public: protected: - Float_t fDigitThreshold ; // Threshold for the digit registration - RecPointsList * fEmcClusters ; // The RecPoints (clusters) list in EMC - AliPHOSGeometry * fGeom ; // geometry definition - Int_t fNTmpHits ; //! used internally for digitalization - Float_t fPinElectronicNoise ; // Electronic Noise in the PIN - RecPointsList * fPpsdClusters ; // The RecPoints (clusters) list in PPSD - AliPHOSReconstructioner * fReconstructioner ; // Reconstrutioner of the PHOS event: Clusterization and subtracking procedures - TClonesArray * fTmpHits ; //! used internally for digitalization + Float_t fDigitThreshold ; // Threshold for the digit registration + RecPointsList * fEmcClusters ; // The RecPoints (clusters) list in EMC + AliPHOSGeometry * fGeom ; // Geometry definition + Int_t fNTmpHits ; //! Used internally for digitalization + Float_t fPinElectronicNoise ; // Electronic Noise in the PIN + RecPointsList * fPpsdClusters ; // The RecPoints (clusters) list in PPSD + AliPHOSReconstructioner * fReconstructioner ; // Reconstrutioner of the PHOS event: Clusterization and subtracking procedures + TClonesArray * fTmpHits ; //! Used internally for digitalization AliPHOSTrackSegmentMaker * fTrackSegmentMaker ; // Reconstructioner of the PHOS track segment: 2 x PPSD + 1 x EMC - TrackSegmentsList * fTrackSegments ; // The TrackSegment list in PHOS - RecParticlesList * fRecParticles ; // The reconstructed particles list in PHOS + TrackSegmentsList * fTrackSegments ; // The TrackSegment list in PHOS + RecParticlesList * fRecParticles ; // The reconstructed particles list in PHOS - ClassDef(AliPHOSv0,1) // PHOS main class , version subatech + ClassDef(AliPHOSv0,1) // Implementation of PHOS manager class for layout EMC+PPSD }; diff --git a/PHOS/AliPHOSv1.cxx b/PHOS/AliPHOSv1.cxx index 49a66670822..e58fea5d828 100644 --- a/PHOS/AliPHOSv1.cxx +++ b/PHOS/AliPHOSv1.cxx @@ -13,16 +13,19 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Manager class for PHOS version SUBATECH -//*-- Author : Odd Harald Oddland & Gines Martinez Feb-2000 -// The main goal of this version of AliPHOS is to calculted the -// induced charged in the PIN diode, taking into account light -// tracking in the PbWO4 crystal, induced signal in the -// PIN due to MIPS particle and electronic noise. -// In this respect, this class derived from AliPHOSv0 and -// only the StepManager function has been "surcharged" -////////////////////////////////////////////////////////////////////////////// +// Implementation version v0 of PHOS Manager class +// Layout EMC + PPSD has name GPS2 +// The main goal of this version of AliPHOS is to calculte the +// induced charged in the PIN diode, taking into account light +// tracking in the PbWO4 crystal, induced signal in the +// PIN due to MIPS particle and electronic noise. +// This is done in the StepManager +// +//*-- Author: Odd Harald Oddland & Gines Martinez (SUBATECH) + // --- ROOT system --- #include "TRandom.h" @@ -33,7 +36,6 @@ #include #include #include -#include // --- AliRoot header files --- @@ -45,55 +47,62 @@ ClassImp(AliPHOSv1) -//____________________________________________________________________________ - AliPHOSv1::AliPHOSv1() : - AliPHOSv0() -{ -} - //____________________________________________________________________________ AliPHOSv1::AliPHOSv1(const char *name, const char *title): AliPHOSv0(name,title) { + // ctor + + // Number of electrons created in the PIN due to light collected in the PbWo4 crystal is calculated using + // following formula + // NumberOfElectrons = EnergyLost * LightYield * PINEfficiency * + // exp (-LightYieldAttenuation * DistanceToPINdiodeFromTheHit) * + // RecalibrationFactor ; + // LightYield is obtained as a Poissonian distribution with a mean at 700000 photons per GeV fromValery Antonenko + // PINEfficiency is 0.1875 from Odd Harald Odland work + // k_0 is 0.0045 from Valery Antonenko + fLightYieldMean = 700000. ; fIntrinsicPINEfficiency = 0.1875 ; fLightYieldAttenuation = 0.0045 ; fRecalibrationFactor = 6.2 / fLightYieldMean ; fElectronsPerGeV = 2.77e+8 ; } + //____________________________________________________________________________ AliPHOSv1::AliPHOSv1(AliPHOSReconstructioner * Reconstructioner, const char *name, const char *title): AliPHOSv0(Reconstructioner,name,title) -{ +{ + // ctor + + // Number of electrons created in the PIN due to light collected in the PbWo4 crystal is calculated using + // following formula + // NumberOfElectrons = EnergyLost * LightYield * PINEfficiency * + // exp (-LightYieldAttenuation * DistanceToPINdiodeFromTheHit) * + // RecalibrationFactor ; + // LightYield is obtained as a Poissonian distribution with a mean at 700000 photons per GeV fromValery Antonenko + // PINEfficiency is 0.1875 from Odd Harald Odland work + // k_0 is 0.0045 from Valery Antonenko + fLightYieldMean = 700000.; fIntrinsicPINEfficiency = 0.1875 ; fLightYieldAttenuation = 0.0045 ; fRecalibrationFactor = 6.2 / fLightYieldMean ; - fElectronsPerGeV = 2.77e+8 ; // Odd Harald work + fElectronsPerGeV = 2.77e+8 ; } -//____________________________________________________________________________ -AliPHOSv1::~AliPHOSv1() -{ - -} - -//____________________________________________________________________________ - - - - - - //____________________________________________________________________________ void AliPHOSv1::StepManager(void) { + // Accumulates hits as long as the track stays in a single crystal or PPSD gas Cell + // Adds the energy deposited in the PIN diode + Int_t relid[4] ; // (box, layer, row, column) indices Float_t xyze[4] ; // position wrt MRS and energy deposited TLorentzVector pos ; Int_t copy; - Float_t lightyield ; // Light Yield per GeV - Float_t nElectrons ; // Number of electrons in the PIN diode + Float_t lightyield ; // Light Yield per GeV + Float_t nElectrons ; // Number of electrons in the PIN diode TString name = fGeom->GetName() ; Float_t global[3] ; Float_t local[3] ; @@ -102,8 +111,7 @@ void AliPHOSv1::StepManager(void) Int_t primary = gAlice->GetPrimary( gAlice->CurrentTrack() ); if ( name == "GPS2" ) { // the CPV is a PPSD - if( gMC->CurrentVolID(copy) == gMC->VolId("GCEL") ) - // if( strcmp ( gMC->CurrentVolName(), "GCEL" ) == 0 ) // We are inside a gas cell + if( gMC->CurrentVolID(copy) == gMC->VolId("GCEL") ) // We are inside a gas cell { gMC->TrackPosition(pos) ; xyze[0] = pos[0] ; @@ -132,8 +140,7 @@ void AliPHOSv1::StepManager(void) } // We are inside the gas of the CPV } // GPS2 configuration - if(gMC->CurrentVolID(copy) == gMC->VolId("PXTL") ) - // if( strcmp ( gMC->CurrentVolName(), "PXTL" ) == 0 ) { // We are inside a PWO crystal + if(gMC->CurrentVolID(copy) == gMC->VolId("PXTL") )// We are inside a PBWO crystal { gMC->TrackPosition(pos) ; xyze[0] = pos[0] ; @@ -181,7 +188,7 @@ void AliPHOSv1::StepManager(void) if ( xyze[3] != 0 ) { gMC->CurrentVolOffID(11, relid[0]) ; // get the PHOS module number ; - relid[1] = 0 ; // means PW04and PIN + relid[1] = 0 ; // means PW04 and PIN gMC->CurrentVolOffID(5, relid[2]) ; // get the row number inside the module gMC->CurrentVolOffID(4, relid[3]) ; // get the cell number inside the module diff --git a/PHOS/AliPHOSv1.h b/PHOS/AliPHOSv1.h index 80357f31c84..d843edb7e67 100644 --- a/PHOS/AliPHOSv1.h +++ b/PHOS/AliPHOSv1.h @@ -3,18 +3,16 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -//////////////////////////////////////////////// -// Manager class for PHOS // -// Version SUBATECH -// Author : Odd Harald Oddland & -// Gines Martinez Feb-2000 -// The main goal of this version of AliPHOS is to calculted the -// induced charged in the PIN diode, taking into account light -// tracking in the PbWO4 crystal, induced signal in the -// PIN due to MIPS particle and electronic noise. -// In this respect, this class derived from AliPHOSv0 and -// only the StepManager function has been "surcharged" -//////////////////////////////////////////////////////////////////// +//_________________________________________________________________________ +// Implementation version v0 of PHOS Manager class +// Layout EMC + PPSD has name GPS2 +// The main goal of this version of AliPHOS is to calculte the +// induced charged in the PIN diode, taking into account light +// tracking in the PbWO4 crystal, induced signal in the +// PIN due to MIPS particle and electronic noise. +// This is done in the StepManager +// +//*-- Author: Odd Harald Oddland & Gines Martinez (SUBATECH) // --- ROOT system --- @@ -27,32 +25,23 @@ class AliPHOSv1 : public AliPHOSv0 { public: - AliPHOSv1(void) ; + AliPHOSv1(void) : AliPHOSv0() {} // ctor AliPHOSv1(const char *name, const char *title="") ; AliPHOSv1(AliPHOSReconstructioner * Reconstructioner, const char *name, const char *title="") ; - virtual ~AliPHOSv1(void) ; + virtual ~AliPHOSv1(void) {} virtual void StepManager(void) ; // does the tracking through PHOS and a preliminary digitalization private: - // - // Number of electrons created in the PIN due to light collected in the PbWo4 crystal is calculated using - // following formula - // NumberOfElectrons = EnergyLost * LightYield * PINEfficiency * - // exp (-LightYieldAttenuation * DistanceToPINdiodeFromTheHit) * - // RecalibrationFactor ; - // LightYield is obtained as a Poissonian distribution with a mean at 700000 photons per GeV fromValery Antonenko - // PINEfficiency is 0.1875 from Odd Harald Odland work - // k_0 is 0.0045 from Valery Antonenko - // - Float_t fLightYieldMean ; // Mean of the Poisson distribution which is the mean lightyield in the PbOW4 xtal per GeV - Float_t fIntrinsicPINEfficiency ; - Float_t fLightYieldAttenuation ; - Float_t fRecalibrationFactor ; - Float_t fElectronsPerGeV ; //Number of electrons per GeV created in the PIN by a ionizing particle - - ClassDef(AliPHOSv1,1) // PHOS v1 main class , version subatech with light transportation, MIPS in PIN and electronic noise + + Float_t fLightYieldMean ; // Mean lightyield in the PbOW4 xtal per GeV (Poisson distribution) + Float_t fIntrinsicPINEfficiency ; // Photo efficiency of the PIN diode + Float_t fLightYieldAttenuation ; // Attenuation of the light through the crystal + Float_t fRecalibrationFactor ; // Recalibration factor + Float_t fElectronsPerGeV ; // Number of electrons per GeV created in the PIN by a ionizing particle + + ClassDef(AliPHOSv1,1) // Implementation of PHOS manager class for layout EMC+PPSD with light transport, MIPS in PIN and electronic noise }; diff --git a/PHOS/AliPHOSvFast.cxx b/PHOS/AliPHOSvFast.cxx index 88f98edbb6c..e62ff687f25 100644 --- a/PHOS/AliPHOSvFast.cxx +++ b/PHOS/AliPHOSvFast.cxx @@ -13,10 +13,16 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //_________________________________________________________________________ -// Manager class for PHOS version for fast simulations -//*-- Author : Y. Schutz SUBATECH -////////////////////////////////////////////////////////////////////////////// +// Implementation of the PHOS manager class for fast simulations +// Tracks particles until the reach a grossly designed PHOS module +// Modify the particles property (momentum, energy, type) according to +// the PHOS response function. The result is called a virtual reconstructed +// particle. +// +//*-- Author: Yves Schutz (SUBATECH) // --- ROOT system --- @@ -27,7 +33,6 @@ // --- Standard library --- #include -#include // --- AliRoot header files --- @@ -40,6 +45,8 @@ ClassImp(AliPHOSvFast) //____________________________________________________________________________ AliPHOSvFast::AliPHOSvFast() { + // ctor + fFastRecParticles = 0 ; fNRecParticles = 0 ; } @@ -48,6 +55,8 @@ AliPHOSvFast::AliPHOSvFast() AliPHOSvFast::AliPHOSvFast(const char *name, const char *title): AliPHOS(name,title) { + // ctor + // gets an instance of the geometry parameters class fGeom = AliPHOSGeometry::GetInstance(title, "") ; @@ -78,6 +87,7 @@ AliPHOSvFast::AliPHOSvFast(const char *name, const char *title): //____________________________________________________________________________ AliPHOSvFast::~AliPHOSvFast() { + // dtor fFastRecParticles->Delete() ; delete fFastRecParticles ; @@ -88,6 +98,8 @@ AliPHOSvFast::~AliPHOSvFast() //____________________________________________________________________________ void AliPHOSvFast::AddRecParticle(const AliPHOSFastRecParticle & rp) { + // Add a virtually reconstructed particle to the list + new( (*fFastRecParticles)[fNRecParticles] ) AliPHOSFastRecParticle(rp) ; fNRecParticles++ ; } @@ -95,9 +107,25 @@ void AliPHOSvFast::AddRecParticle(const AliPHOSFastRecParticle & rp) //____________________________________________________________________________ void AliPHOSvFast::BuildGeometry() { - // Build the PHOS geometry for the ROOT display - + //BEGIN_HTML + /* +

+ PHOS FAST in ALICE displayed by root +

+

All Views

+

+

+ Fast All Views +

+

Front View

+

+

+ Fast Front View +

+ */ + //END_HTML + const Int_t kColorPHOS = kRed ; Double_t const kRADDEG = 180.0 / kPI ; @@ -108,9 +136,9 @@ void AliPHOSvFast::BuildGeometry() // position PHOS into ALICE - Float_t r = fGeom->GetIPtoOuterCoverDistance() + GetBigBox(1) / 2.0 ; + Float_t r = fGeom->GetIPtoCrystalSurface() + GetBigBox(1) / 2.0 ; Int_t number = 988 ; - Float_t pphi = TMath::ATan( GetBigBox(0) / ( 2.0 * fGeom->GetIPtoOuterCoverDistance() ) ) ; + Float_t pphi = TMath::ATan( GetBigBox(0) / ( 2.0 * fGeom->GetIPtoCrystalSurface() ) ) ; pphi *= kRADDEG ; TNode * top = gAlice->GetGeometry()->GetNode("alice") ; @@ -136,9 +164,10 @@ void AliPHOSvFast::BuildGeometry() //____________________________________________________________________________ void AliPHOSvFast::CreateGeometry() { - + // Create the geometry for GEANT + AliPHOSvFast *phostmp = (AliPHOSvFast*)gAlice->GetModule("PHOS") ; - + if ( phostmp == NULL ) { fprintf(stderr, "PHOS detector not found!\n") ; @@ -166,7 +195,7 @@ void AliPHOSvFast::CreateGeometry() Float_t angle = fGeom->GetPHOSAngle(i) ; AliMatrix(idrotm[i-1], 90.0, angle, 90.0, 90.0+angle, 0.0, 0.0) ; - Float_t r = fGeom->GetIPtoOuterCoverDistance() + GetBigBox(1) / 2.0 ; + Float_t r = fGeom->GetIPtoCrystalSurface() + GetBigBox(1) / 2.0 ; Float_t xP1 = r * TMath::Sin( angle / kRADDEG ) ; Float_t yP1 = -r * TMath::Cos( angle / kRADDEG ) ; @@ -180,7 +209,8 @@ void AliPHOSvFast::CreateGeometry() //____________________________________________________________________________ void AliPHOSvFast::Init(void) { - + // Prints out an information message + Int_t i; printf("\n"); @@ -199,6 +229,8 @@ void AliPHOSvFast::Init(void) //___________________________________________________________________________ Float_t AliPHOSvFast::GetBigBox(Int_t index) { + // Get the X, Y or Z dimension of the box describing a PHOS module + Float_t rv = 0 ; switch (index) { @@ -218,8 +250,7 @@ Float_t AliPHOSvFast::GetBigBox(Int_t index) //___________________________________________________________________________ void AliPHOSvFast::MakeBranch(Option_t* opt) { - // - // Create a new branch in the current Root Tree + // Create new branch in the current reconstructed Root Tree AliDetector::MakeBranch(opt) ; @@ -235,6 +266,9 @@ void AliPHOSvFast::MakeBranch(Option_t* opt) //____________________________________________________________________________ Double_t AliPHOSvFast::MakeEnergy(const Double_t energy) { + // Smears the energy according to the energy dependent energy resolution. + // A gaussian distribution is assumed + Double_t sigma = SigmaE(energy) ; return fRan.Gaus(energy, sigma) ; } @@ -242,6 +276,9 @@ Double_t AliPHOSvFast::MakeEnergy(const Double_t energy) //____________________________________________________________________________ TVector3 AliPHOSvFast::MakePosition(const Double_t energy, const TVector3 pos, const Double_t theta, const Double_t phi) { + // Smears the impact position according to the energy dependent position resolution + // A gaussian position distribution is assumed + TVector3 newpos ; Double_t sigma = SigmaP( energy, theta*180./TMath::Pi() ) ; Double_t x = fRan.Gaus( pos.X(), sigma ) ; @@ -259,8 +296,10 @@ TVector3 AliPHOSvFast::MakePosition(const Double_t energy, const TVector3 pos, c //____________________________________________________________________________ void AliPHOSvFast::MakeRecParticle(const Int_t modid, const TVector3 pos, AliPHOSFastRecParticle & rp) { - // get the detected type of particle - + // Modify the primary particle properties according + // 1. the response function of PHOS + // 2. the performance of the EMC+PPSD setup + Int_t type = MakeType( rp ) ; rp.SetType(type) ; @@ -293,6 +332,8 @@ void AliPHOSvFast::MakeRecParticle(const Int_t modid, const TVector3 pos, AliPHO //____________________________________________________________________________ Int_t AliPHOSvFast::MakeType(AliPHOSFastRecParticle & rp ) { + // Generate a particle type using the performance of the EMC+PPSD setup + Int_t rv = kUNDEFINED ; Int_t charge = (Int_t)rp.GetPDG()->Charge() ; Int_t test ; @@ -366,12 +407,16 @@ Int_t AliPHOSvFast::MakeType(AliPHOSFastRecParticle & rp ) //___________________________________________________________________________ void AliPHOSvFast::ResetPoints() { + // This overloads the method in AliDetector + ResetFastRecParticles() ; } //___________________________________________________________________________ void AliPHOSvFast::ResetFastRecParticles() { + // Resets the list of virtual reconstructed particles + if (fFastRecParticles) fFastRecParticles->Clear() ; fNRecParticles = 0 ; @@ -380,7 +425,8 @@ void AliPHOSvFast::ResetFastRecParticles() //___________________________________________________________________________ void AliPHOSvFast::SetBigBox(Int_t index, Float_t value) { - + // Set the size of the Box describing a PHOS module + switch (index) { case 0: fBigBoxX = value ; @@ -398,6 +444,8 @@ void AliPHOSvFast::SetBigBox(Int_t index, Float_t value) //____________________________________________________________________________ Double_t AliPHOSvFast::SigmaE(Double_t energy) { + // Calculates the energy dependent energy resolution + Double_t rv = -1 ; rv = TMath::Sqrt( TMath::Power(fResPara1/energy, 2) @@ -410,7 +458,8 @@ Double_t AliPHOSvFast::SigmaE(Double_t energy) //____________________________________________________________________________ Double_t AliPHOSvFast::SigmaP(Double_t energy, Int_t incidence) { - + // Calculates the energy dependent position resolution + Double_t paraA = fPosParaA0 + fPosParaA1 * incidence ; Double_t paraB = fPosParaB0 + fPosParaB1 * incidence + fPosParaB2 * incidence * incidence ; @@ -420,7 +469,8 @@ Double_t AliPHOSvFast::SigmaP(Double_t energy, Int_t incidence) //____________________________________________________________________________ void AliPHOSvFast::StepManager(void) { - + // Only verifies if the particle reaches PHOS and stops the tracking + Int_t primary = gAlice->GetPrimary( gAlice->CurrentTrack() ); TLorentzVector lv ; gMC->TrackPosition(lv) ; @@ -434,6 +484,7 @@ void AliPHOSvFast::StepManager(void) TParticle * part = (TParticle *)particlelist->At(primary) ; AliPHOSFastRecParticle rp(*part) ; + rp.SetPrimary(primary) ; // Adds the response of PHOS to the particle diff --git a/PHOS/AliPHOSvFast.h b/PHOS/AliPHOSvFast.h index a61c391d847..90a2c790dd9 100644 --- a/PHOS/AliPHOSvFast.h +++ b/PHOS/AliPHOSvFast.h @@ -3,16 +3,17 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -//////////////////////////////////////////////// -// Manager class for PHOS // -// Version SUBATECH // -// Author Y. Schutz SUBATECH // -// This is the class to be used for // -// fast simulations // -//////////////////////////////////////////////// - /* $Id$ */ +//_________________________________________________________________________ +// Implementation of the PHOS manager class for fast simulations +// Tracks particles until the reach a grossly designed PHOS module +// Modify the particles property (momentum, energy, type) according to +// the PHOS response function. The result is called a virtual reconstructed +// particle. +// +//*-- Author: Yves Schutz (SUBATECH) + // --- ROOT system --- #include "TClonesArray.h" #include "TRandom.h" @@ -70,7 +71,7 @@ private: Double_t fPosParaB1 ; // parameter for the position resolution Double_t fPosParaB2 ; // parameter for the position resolution - ClassDef(AliPHOSvFast,1) // PHOS main class , version for fast simulation + ClassDef(AliPHOSvFast,1) // Implementation of the PHOS manager class for fast simulations }; diff --git a/PHOS/Makefile b/PHOS/Makefile index 2bdde88b0c6..d7e248ddc11 100644 --- a/PHOS/Makefile +++ b/PHOS/Makefile @@ -11,13 +11,14 @@ PACKAGE = PHOS SRCS = AliPHOS.cxx AliPHOSv0.cxx AliPHOSv1.cxx AliPHOSHit.cxx \ AliPHOSGeometry.cxx \ - AliPHOSDigit.cxx \ + AliPHOSDigit.cxx \ AliPHOSRecPoint.cxx AliPHOSEmcRecPoint.cxx AliPHOSPpsdRecPoint.cxx \ AliPHOSClusterizer.cxx AliPHOSClusterizerv1.cxx AliPHOSLink.cxx \ AliPHOSReconstructioner.cxx AliPHOSTrackSegment.cxx \ AliPHOSTrackSegmentMaker.cxx AliPHOSTrackSegmentMakerv1.cxx \ AliPHOSRecParticle.cxx AliPHOSPID.cxx AliPHOSPIDv1.cxx \ - AliPHOSAnalyze.cxx AliPHOSvFast.cxx AliPHOSFastRecParticle.cxx + AliPHOSAnalyze.cxx AliPHOSvFast.cxx AliPHOSFastRecParticle.cxx \ + AliPHOSArray.cxx # C++ Headers diff --git a/PHOS/PHOS-HTML/fastsimulation.html b/PHOS/PHOS-HTML/fastsimulation.html index 94ad1904789..fee92c90041 100644 --- a/PHOS/PHOS-HTML/fastsimulation.html +++ b/PHOS/PHOS-HTML/fastsimulation.html @@ -19,8 +19,30 @@ that each sub-detector makes a Use Case for a fast simulation scheme. Here is wh

[Use Case for fast simulation]
+

+This has been implemented in a new class AliPHOSvFast ( +inheritance tree ). The synopsis goes as follow : +

+

      
+      AliPHOSvFast::AliDetector
+      
+      CreateGeometry()  {
+
+       describes the coarse outline of PHOS as 5 boxes }
+
+      StepManager() {
+
+       when particle reaches PHOS {
+         stop the tracking
+         modifiy the attributes (energy, momentum, type) of the primary particle according to the PHOS response
+         construct a "virtual" reconstructed particle }
+       save the reconstructed particle in a list }
 
+      FinishEvent() {
 
+        write the list in TreeR
+        write the TreeR to file }
+

© Groupe Photons Subatech [Go @@ -29,7 +51,7 @@ to the GPS Home Page]
-Last modified: Wed Dec 7 18:54:10 CET 1999 +Last modified: Sun Mar 12 23:52:09 CET 2000
Valid HTML 4.0!Valid CSS!
diff --git a/PHOS/PHOS-HTML/geometry.html b/PHOS/PHOS-HTML/geometry.html index ccfb0492d28..76f8449d8bc 100644 --- a/PHOS/PHOS-HTML/geometry.html +++ b/PHOS/PHOS-HTML/geometry.html @@ -6,9 +6,8 @@ PHOS Geometry in AliRoot - - - + +

Geometry & Materials

@@ -81,11 +80,22 @@ detectors per PHOS module, each detectors being subdivided into fNumberOfPads x fNumberOfPadsZ gas cells, a Lead converter and a second layer of gas detectors identical to the first layer. This second part is positionned on top of the EMCA module. +

+The class AliPHOSv0 ( inheritance tree ) describes this geometry. We have defined also a class + AliPHOSv1 ( inheritance tree ) which in addition contains the photodiode response and the light transport through the crystal. +

+The parameters of the geometry are given in class AliPHOSGeometry ( inheritance tree )

- Geant Tree for PHOS + Geant Tree for PHOS +

+ Figure 1.a: GEANT Tree which describes the EMC-PHOS geometry +
+

+

+ Geant Tree for PHOS

- Figure 1.: GEANT Tree which describes the PHOS geometry + Figure 1.b: GEANT Tree which describes the PPSD-PHOS geometry

@@ -165,23 +175,20 @@ AliPHOS * phos = new AliPHOSv4("PHOS", char * name) ; GPS2: will create EMCA plus PPSD

- - - - - - - - -
- Geant display of PHOS - - Root display of Alice -
- Figure 3.: GEANT display of ALICE - - Figure 4.: Root display of ALICE -
+ ROOT display of PHOS: All Views + Figure 3a.: ROOT Display of ALICE: All Views +

+ ROOT display of PHOS: Front View + Figure 3b.: ROOT Display of ALICE: Front Views +

+ ROOT display of PHOS: 3D View + Figure 3c.: ROOT Display of ALICE: All View3 +

+ Zoom on PPSD: Front View + Figure 4.a: ROOT Display of ALICE: zoom on PPSD, Front Views +

+ Zoom on PPSD: Perspective View + Figure 4.b: ROOT Display of ALICE: zoom on PPSD, Perspective View



@@ -202,7 +209,7 @@ EMCA module of 2 layers of 4x4 gas detectors each, each detector having -Last modified: Tue Nov 23 09:49:02 CET 1999 +Last modified: Sun Mar 12 23:49:58 CET 2000
Valid HTML 4.0!Valid CSS!
diff --git a/PHOS/PHOS-HTML/index.html b/PHOS/PHOS-HTML/index.html index 2f10154b25b..6948ee1f34f 100644 --- a/PHOS/PHOS-HTML/index.html +++ b/PHOS/PHOS-HTML/index.html @@ -5,9 +5,9 @@ PHOS in AliRoot - - - + +