+/***************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
//-----------------------------------------------------//
// //
// Source File : PMDDigitizer.cxx, Version 00 //
#include "AliMC.h"
ClassImp(AliPMDDigitizer)
-//
-// Constructor
-//
+
AliPMDDigitizer::AliPMDDigitizer()
{
// Default Constructor
//
// Member functions
//
-void AliPMDDigitizer::OpengAliceFile(Char_t *file, Option_t *option)
+void AliPMDDigitizer::OpengAliceFile(const char *file, Option_t *option)
{
// Loads galice.root file and corresponding header, kinematics
// hits and sdigits or digits depending on the option
//
- fRunLoader = AliRunLoader::Open(file,AliConfig::fgkDefaultEventFolderName,
- "UPDATE");
+ fRunLoader = AliRunLoader::Open(file,AliConfig::fgkDefaultEventFolderName);
if (!fRunLoader)
{
fRunLoader->LoadHeader();
fRunLoader->LoadKinematics();
- fAlice = fRunLoader->GetAliRun();
+ gAlice = fRunLoader->GetAliRun();
- if (fAlice)
+ if (gAlice)
{
printf("<AliPMDdigitizer::Open> ");
printf("AliRun object found on file.\n");
printf("Could not find AliRun object.\n");
}
- fPMD = (AliPMD*)fAlice->GetDetector("PMD");
+ fPMD = (AliPMD*)gAlice->GetDetector("PMD");
fPMDLoader = fRunLoader->GetLoader("PMDLoader");
if (fPMDLoader == 0x0)
{
Float_t edep;
Float_t vx = -999.0, vy = -999.0, vz = -999.0;
-
+
ResetSDigit();
printf("Event Number = %d \n",ievt);
Int_t nparticles = fRunLoader->GetHeader()->GetNtrack();
printf("Number of Particles = %d \n", nparticles);
fRunLoader->GetEvent(ievt);
- fPArray = fAlice->GetMCApp()->Particles();
+ // fPArray = gAlice->GetMCApp()->Particles();
// ------------------------------------------------------- //
// Pointer to specific detector hits.
// Get pointers to Alice detectors and Hits containers
// Start loop on tracks in the hits containers
-
for (Int_t track=0; track<ntracks;track++)
{
- fAlice->ResetHits();
+ gAlice->ResetHits();
fTreeH->GetEvent(track);
-
if (fPMD)
{
npmd = fHits->GetEntriesFast();
{
fPMDHit = (AliPMDhit*) fHits->UncheckedAt(ipmd);
trackno = fPMDHit->GetTrack();
-
// get kinematics of the particles
- fParticle = fAlice->GetMCApp()->Particle(trackno);
+ fParticle = gAlice->GetMCApp()->Particle(trackno);
trackpid = fParticle->GetPdgCode();
Int_t igatr = -999;
trackpidOld = trackpid;
statusOld = -1;
}
-
Int_t igstatus = 0;
while((imo = mparticle->GetFirstMother()) >= 0)
{
igen++;
- mparticle = fAlice->GetMCApp()->Particle(imo);
+ mparticle = gAlice->GetMCApp()->Particle(imo);
idmo = mparticle->GetPdgCode();
vx = mparticle->Vx();
mtrackno = tracknoOld;
mtrackpid = trackpidOld;
}
-
xPos = fPMDHit->X();
yPos = fPMDHit->Y();
zPos = fPMDHit->Z();
Float_t edep;
Float_t vx = -999.0, vy = -999.0, vz = -999.0;
-
ResetDigit();
printf("Event Number = %d \n",ievt);
Int_t nparticles = fRunLoader->GetHeader()->GetNtrack();
printf("Number of Particles = %d \n", nparticles);
fRunLoader->GetEvent(ievt);
- fPArray = fAlice->GetMCApp()->Particles();
+ // fPArray = gAlice->GetMCApp()->Particles();
// ------------------------------------------------------- //
// Pointer to specific detector hits.
// Get pointers to Alice detectors and Hits containers
- fPMD = (AliPMD*)fAlice->GetDetector("PMD");
+ fPMD = (AliPMD*)gAlice->GetDetector("PMD");
fPMDLoader = fRunLoader->GetLoader("PMDLoader");
if (fPMDLoader == 0x0)
for (Int_t track=0; track<ntracks;track++)
{
- fAlice->ResetHits();
+ gAlice->ResetHits();
fTreeH->GetEvent(track);
if (fPMD)
// get kinematics of the particles
- fParticle = fAlice->GetMCApp()->Particle(trackno);
+ fParticle = gAlice->GetMCApp()->Particle(trackno);
trackpid = fParticle->GetPdgCode();
Int_t igatr = -999;
{
igen++;
- mparticle = fAlice->GetMCApp()->Particle(imo);
+ mparticle = gAlice->GetMCApp()->Particle(imo);
idmo = mparticle->GetPdgCode();
vx = mparticle->Vx();
//
}
-
-void AliPMDDigitizer::MeV2ADC(Float_t mev, Float_t & adc)
+void AliPMDDigitizer::MeV2ADC(Float_t mev, Float_t & adc) const
{
// This converts the simulated edep to ADC according to the
// Test Beam Data