* 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 ---
// --- Standard library ---
-#include <cstdio>
-#include <cassert>
+#include <stdio.h>
// --- AliRoot header files ---
//____________________________________________________________________________
AliPHOSvFast::AliPHOSvFast()
{
+ // ctor
+
fFastRecParticles = 0 ;
fNRecParticles = 0 ;
}
AliPHOSvFast::AliPHOSvFast(const char *name, const char *title):
AliPHOS(name,title)
{
+ // ctor
+
// gets an instance of the geometry parameters class
fGeom = AliPHOSGeometry::GetInstance(title, "") ;
SetBigBox(2, fGeom->GetOuterBoxSize(0) );
fNRecParticles = 0 ;
- fFastRecParticles = new FastRecParticlesList("AliPHOSFastRecParticle", 100) ;
+ fFastRecParticles = new AliPHOSFastRecParticle::FastRecParticlesList("AliPHOSFastRecParticle", 100) ;
fResPara1 = 0.030 ; // GeV
fResPara2 = 0.00003 ;
//____________________________________________________________________________
AliPHOSvFast::~AliPHOSvFast()
{
+ // dtor
fFastRecParticles->Delete() ;
delete fFastRecParticles ;
//____________________________________________________________________________
void AliPHOSvFast::AddRecParticle(const AliPHOSFastRecParticle & rp)
{
- new( (*fFastRecParticles)[fNRecParticles] ) AliPHOSFastRecParticle(rp) ;
- fNRecParticles++ ;
+ // Add a virtually reconstructed particle to the list
+
+ new( (*fFastRecParticles)[fNRecParticles] ) AliPHOSFastRecParticle(rp) ;
+ fNRecParticles++ ;
}
//____________________________________________________________________________
void AliPHOSvFast::BuildGeometry()
{
-
// Build the PHOS geometry for the ROOT display
-
+ //BEGIN_HTML
+ /*
+ <H2>
+ PHOS FAST in ALICE displayed by root
+ </H2>
+ <H4> All Views </H4>
+ <P>
+ <CENTER>
+ <IMG Align=BOTTOM ALT="Fast All Views" SRC="../images/AliPHOSvFastAllViews.gif">
+ </CENTER></P>
+ <H4> Front View </H4>
+ <P>
+ <CENTER>
+ <IMG Align=BOTTOM ALT="Fast Front View" SRC="../images/AliPHOSvFastFrontView.gif">
+ </CENTER></P>
+ */
+ //END_HTML
+
const Int_t kColorPHOS = kRed ;
Double_t const kRADDEG = 180.0 / kPI ;
// 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") ;
//____________________________________________________________________________
void AliPHOSvFast::CreateGeometry()
{
-
+ // Create the geometry for GEANT
+
AliPHOSvFast *phostmp = (AliPHOSvFast*)gAlice->GetModule("PHOS") ;
-
+
if ( phostmp == NULL ) {
fprintf(stderr, "PHOS detector not found!\n") ;
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 ) ;
//____________________________________________________________________________
void AliPHOSvFast::Init(void)
{
-
+ // Prints out an information message
+
Int_t i;
printf("\n");
//___________________________________________________________________________
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) {
//___________________________________________________________________________
void AliPHOSvFast::MakeBranch(Option_t* opt)
{
- //
- // Create a new branch in the current Root Tree
- // The branch of fHits is automatically split
- //
+ // Create new branch in the current reconstructed Root Tree
+
AliDetector::MakeBranch(opt) ;
char branchname[10];
//____________________________________________________________________________
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) ;
}
//____________________________________________________________________________
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 ) ;
//____________________________________________________________________________
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) ;
//____________________________________________________________________________
Int_t AliPHOSvFast::MakeType(AliPHOSFastRecParticle & rp )
{
- Int_t rv = kUNDEFINED ;
+ // Generate a particle type using the performance of the EMC+PPSD setup
+
+ Int_t rv = AliPHOSFastRecParticle::kUNDEFINED ;
Int_t charge = (Int_t)rp.GetPDG()->Charge() ;
Int_t test ;
Float_t ran ;
- if ( charge == 0 && ( TMath::Abs(rp.GetPdgCode()) != 11 ) )
+ if ( charge != 0 && ( TMath::Abs(rp.GetPdgCode()) != 11 ) )
test = - 1 ;
else
test = rp.GetPdgCode() ;
case 22: // it's a photon
ran = fRan.Rndm() ;
if ( ran <= 0.5 ) // 50 %
- rv = kGAMMA ;
+ rv = AliPHOSFastRecParticle::kGAMMA ;
else {
ran = fRan.Rndm() ;
if( ran <= 0.9498 )
- rv = kNEUTRALEM ;
+ rv = AliPHOSFastRecParticle::kNEUTRALEM ;
else
- rv = kNEUTRALHADRON ;
+ rv = AliPHOSFastRecParticle::kNEUTRALHA ;
}
break ;
case 2112: // it's a neutron
ran = fRan.Rndm() ;
if ( ran <= 0.9998 )
- rv = kNEUTRALHADRON ;
+ rv = AliPHOSFastRecParticle::kNEUTRALHA ;
else
- rv = kNEUTRALEM ;
+ rv = AliPHOSFastRecParticle::kNEUTRALEM ;
break ;
case -2112: // it's a anti-neutron
ran = fRan.Rndm() ;
if ( ran <= 0.9984 )
- rv = kNEUTRALHADRON ;
+ rv = AliPHOSFastRecParticle::kNEUTRALHA ;
else
- rv = kNEUTRALEM ;
+ rv = AliPHOSFastRecParticle::kNEUTRALEM ;
break ;
case 11: // it's a electron
ran = fRan.Rndm() ;
if ( ran <= 0.9996 )
- rv = kELECTRON ;
+ rv = AliPHOSFastRecParticle::kELECTRON ;
else
- rv = kCHARGEDHADRON ;
+ rv = AliPHOSFastRecParticle::kCHARGEDHA ;
break;
- case -11: // it's a electron
+ case -11: // it's a positon
ran = fRan.Rndm() ;
if ( ran <= 0.9996 )
- rv = kELECTRON ;
+ rv = AliPHOSFastRecParticle::kELECTRON ;
else
- rv = kCHARGEDHADRON ;
+ rv = AliPHOSFastRecParticle::kCHARGEDHA ;
break;
case -1: // it's a charged
ran = fRan.Rndm() ;
if ( ran <= 0.9996 )
- rv = kCHARGEDHADRON ;
+ rv = AliPHOSFastRecParticle::kCHARGEDHA ;
else
- rv = kGAMMA ;
+ rv = AliPHOSFastRecParticle::kGAMMA ;
break ;
}
}
//___________________________________________________________________________
-void AliPHOSvFast::SetBigBox(Int_t index, Float_t value)
+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 ;
+}
+//___________________________________________________________________________
+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 ;
//____________________________________________________________________________
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)
//____________________________________________________________________________
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 ;
//____________________________________________________________________________
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) ;
TParticle * part = (TParticle *)particlelist->At(primary) ;
AliPHOSFastRecParticle rp(*part) ;
+ rp.SetPrimary(primary) ;
// Adds the response of PHOS to the particle