//-----------------------------------------------------//
#include <Riostream.h>
+#include <TBRIK.h>
+#include <TNode.h>
#include <TTree.h>
+#include <TGeometry.h>
#include <TObjArray.h>
#include <TClonesArray.h>
#include <TFile.h>
{
for (Int_t k = 0; k < fgkCol; k++)
{
- fCPV[i][j][k] = 0.;
- fPRE[i][j][k] = 0.;
- fCPVCounter[i][j][k] = 0;
- fPRECounter[i][j][k] = 0;
- fCPVTrackNo[i][j][k] = -1;
- fPRETrackNo[i][j][k] = -1;
+ fCPV[i][j][k] = 0.;
+ fPRE[i][j][k] = 0.;
+ fCPVCounter[i][j][k] = 0;
+ fPRECounter[i][j][k] = 0;
+ fCPVTrackNo[i][j][k] = -1;
+ fPRETrackNo[i][j][k] = -1;
+ fCPVTrackPid[i][j][k] = -1;
+ fPRETrackPid[i][j][k] = -1;
}
}
}
{
for (Int_t k = 0; k < fgkCol; k++)
{
- fCPV[i][j][k] = 0.;
- fPRE[i][j][k] = 0.;
- fCPVCounter[i][j][k] = 0;
- fPRECounter[i][j][k] = 0;
- fCPVTrackNo[i][j][k] = -1;
- fPRETrackNo[i][j][k] = -1;
+ fCPV[i][j][k] = 0.;
+ fPRE[i][j][k] = 0.;
+ fCPVCounter[i][j][k] = 0;
+ fPRECounter[i][j][k] = 0;
+ fCPVTrackNo[i][j][k] = -1;
+ fPRETrackNo[i][j][k] = -1;
+ fCPVTrackPid[i][j][k] = -1;
+ fPRETrackPid[i][j][k] = -1;
}
}
}
AliDebug(1,Form("Event Number = %d",ievt));
Int_t nparticles = fRunLoader->GetHeader()->GetNtrack();
AliDebug(1,Form("Number of Particles = %d",nparticles));
+
+ //
+
fRunLoader->GetEvent(ievt);
// ------------------------------------------------------- //
// Pointer to specific detector hits.
statusOld = -1;
}
Int_t igstatus = 0;
- //------------------modified by Mriganka ----------------------
+
+ Int_t trnotemp = trackno; // Modified on 25th Nov 2009
if(ks==1||(imo = mparticle->GetFirstMother())<0 ){
vx = mparticle->Vx();
vy = mparticle->Vy();
vy = mparticle->Vy();
vz = mparticle->Vz();
- trackno=imo;
-
+ // Modified on 25th Nov 2009
+
+ trnotemp = trackno;
+ if(trackpid == 111)
+ {
+ trackno = trnotemp;
+ }
+ if(trackpid != 111)
+ {
+ trackno=imo;
}
+ // end of modification on 25th Nov 2009
+ }
if(trackpid==kGamma||trackpid==11||trackpid==-11||
trackpid==kPi0)igstatus=1;
trackno=tracknoOld;
//-----------------end of modification----------------
+ Float_t ptime = fPMDHit->GetTime()*1e6; // time in microsec
+ if (ptime < 0. || ptime > 1.2) continue;
+
xPos = fPMDHit->X();
yPos = fPMDHit->Y();
zPos = fPMDHit->Z();
-
+
edep = fPMDHit->GetEnergy();
Int_t vol1 = fPMDHit->GetVolume(1); // Column
Int_t vol2 = fPMDHit->GetVolume(2); // Row
- Int_t vol7 = fPMDHit->GetVolume(7); // UnitModule
- Int_t vol8 = fPMDHit->GetVolume(8); // SuperModule
+ Int_t vol7 = fPMDHit->GetVolume(4); // Serial Module No
// -----------------------------------------//
// nrow = 96, ncol = 48 //
// -----------------------------------------//
-
-
- smnumber = (vol8-1)*6 + vol7;
+ if (vol7 < 24)
+ {
+ smnumber = vol7;
+ }
+ else
+ {
+ smnumber = vol7 - 24;
+ }
+ Int_t vol8 = smnumber/6 + 1; // fake supermodule
if (vol8 == 1 || vol8 == 2)
{
}
AliDebug(2,Form("Zposition = %f Edeposition = %f",zPos,edep));
- //Float_t zposition = TMath::Abs(zPos);
- if (zPos < fZPos)
+
+ if (vol7 < 24)
{
- // CPV
- fDetNo = 1;
+ // PRE
+ fDetNo = 0;
}
- else if (zPos > fZPos)
+ else
{
- // PMD
- fDetNo = 0;
+ // CPV
+ fDetNo = 1;
}
- Int_t smn = smnumber - 1;
+
+ Int_t smn = smnumber;
Int_t ixx = xpad - 1;
Int_t iyy = ypad - 1;
if (fDetNo == 0)
Float_t deltaE = 0.;
Int_t detno = 0;
Int_t trno = -1;
+ Int_t trpid = -99;
for (Int_t idet = 0; idet < 2; idet++)
{
}
if (deltaE > 0.)
{
- AddSDigit(trno,detno,ism,jrow,kcol,deltaE);
+ // Natasha
+ TParticle *mparticle = gAlice->GetMCApp()->Particle(trno);
+ trpid = mparticle->GetPdgCode();
+ AddSDigit(trno,trpid,detno,ism,jrow,kcol,deltaE);
}
}
}
AliDebug(1,Form("Event Number = %d",ievt));
Int_t nparticles = fRunLoader->GetHeader()->GetNtrack();
AliDebug(1,Form("Number of Particles = %d", nparticles));
+
fRunLoader->GetEvent(ievt);
// ------------------------------------------------------- //
// Pointer to specific detector hits.
}
Int_t igstatus = 0;
- //-----------------------modified by Mriganka ------------------
+
+ Int_t trnotemp = trackno; // modified on 25th Nov 2009
if(ks==1||(imo = mparticle->GetFirstMother())<0 ){
vx = mparticle->Vx();
vy = mparticle->Vy();
vy = mparticle->Vy();
vz = mparticle->Vz();
- trackno=imo;
-
+ // Modified on 25th Nov 2009
+
+ trnotemp = trackno;
+ if(trackpid == 111)
+ {
+ trackno = trnotemp;
}
+ if(trackpid != 111)
+ {
+ trackno=imo;
+ }
+ }
if(trackpid==kGamma||trackpid==11||trackpid==-11||trackpid==kPi0)
igstatus=1;
mtrackno=trackno;
trackpid=trackpidOld;
trackno=tracknoOld;
+
+ Float_t ptime = fPMDHit->GetTime()*1e6;
+ if (ptime < 0. || ptime > 1.2) continue;
- //-----------------end of modification----------------
xPos = fPMDHit->X();
yPos = fPMDHit->Y();
zPos = fPMDHit->Z();
edep = fPMDHit->GetEnergy();
Int_t vol1 = fPMDHit->GetVolume(1); // Column
Int_t vol2 = fPMDHit->GetVolume(2); // Row
- Int_t vol7 = fPMDHit->GetVolume(7); // UnitModule
- Int_t vol8 = fPMDHit->GetVolume(8); // SuperModule
-
+ Int_t vol7 = fPMDHit->GetVolume(4); // Serial Module No
// -----------------------------------------//
// In new geometry after adding electronics //
// nrow = 96, ncol = 48 //
// -----------------------------------------//
- smnumber = (vol8-1)*6 + vol7;
+ if (vol7 < 24)
+ {
+ smnumber = vol7;
+ }
+ else
+ {
+ smnumber = vol7 - 24;
+ }
+ Int_t vol8 = smnumber/6 + 1; // fake supermodule
if (vol8 == 1 || vol8 == 2)
{
}
AliDebug(2,Form("ZPosition = %f Edeposition = %d",zPos,edep));
- //Float_t zposition = TMath::Abs(zPos);
- if (zPos < fZPos)
+ if (vol7 < 24)
+ {
+ // PRE
+ fDetNo = 0;
+ }
+ else
{
- // CPV
fDetNo = 1;
}
- else if (zPos > fZPos)
+ /*
+ if (zPos < fZPos)
{
- // PMD
- fDetNo = 0;
+ // CPV
+ fDetNo = 1;
}
-
- Int_t smn = smnumber - 1;
+ else if (zPos > fZPos)
+ {
+ // PMD
+ fDetNo = 0;
+ }
+ */
+ Int_t smn = smnumber;
Int_t ixx = xpad - 1;
Int_t iyy = ypad - 1;
if (fDetNo == 0)
Float_t deltaE = 0.;
Int_t detno = 0;
Int_t trno = 1;
+ Int_t trpid = -99;
+
for (Int_t idet = 0; idet < 2; idet++)
{
for (Int_t ism = 0; ism < fgkTotUM; ism++)
{
deltaE = fPRE[ism][jrow][kcol];
trno = fPRETrackNo[ism][jrow][kcol];
- detno = 0;
+ detno = 0;
}
else if (idet == 1)
{
deltaE = fCPV[ism][jrow][kcol];
trno = fCPVTrackNo[ism][jrow][kcol];
- detno = 1;
+ detno = 1;
}
if (deltaE > 0.)
{
if (adc > 0.)
{
adc += (pedmean + 3.0*pedrms);
- AddDigit(trno,detno,ism,jrow,kcol,adc);
+ TParticle *mparticle
+ = gAlice->GetMCApp()->Particle(trno);
+ trpid = mparticle->GetPdgCode();
+
+ AddDigit(trno,trpid,detno,ism,jrow,kcol,adc);
}
}
} // column loop
fPMDLoader->WriteDigits("OVERWRITE");
ResetCellADC();
-
+
}
//____________________________________________________________________________
if (!fDigits) fDigits = new TClonesArray("AliPMDdigit", 1000);
treeD->Branch("PMDDigit", &fDigits, bufsize);
- Int_t trno, det, smn;
+ Int_t trno, trpid, det, smn;
Int_t irow, icol;
Float_t edep, adc;
{
pmdsdigit = (AliPMDsdigit*)fSDigits->UncheckedAt(ient);
trno = pmdsdigit->GetTrackNumber();
+ trpid = pmdsdigit->GetTrackPid();
det = pmdsdigit->GetDetector();
smn = pmdsdigit->GetSMNumber();
irow = pmdsdigit->GetRow();
if(adc > 0.)
{
adc += (pedmean + 3.0*pedrms);
- AddDigit(trno,det,smn,irow,icol,adc);
+ AddDigit(trno,trpid,det,smn,irow,icol,adc);
}
}
Float_t adc;
Float_t deltaE = 0.;
- Int_t detno = 0;
- Int_t trno = 1;
+ Int_t detno = 0;
+ Int_t trno = 1;
+ Int_t trpid = -99;
for (Int_t idet = 0; idet < 2; idet++)
{
{
deltaE = fPRE[ism][jrow][kcol];
trno = fPRETrackNo[ism][jrow][kcol];
- detno = 0;
+ trpid = fPRETrackPid[ism][jrow][kcol];
+ detno = 0;
}
else if (idet == 1)
{
deltaE = fCPV[ism][jrow][kcol];
trno = fCPVTrackNo[ism][jrow][kcol];
- detno = 1;
+ trpid = fCPVTrackPid[ism][jrow][kcol];
+ detno = 1;
}
if (deltaE > 0.)
{
if (adc > 0.)
{
adc += (pedmean + 3.0*pedrms);
- AddDigit(trno,detno,ism,jrow,kcol,adc);
+ AddDigit(trno,trpid,detno,ism,jrow,kcol,adc);
}
}
if (!fSDigits) fSDigits = new TClonesArray("AliPMDsdigit", 1000);
branch->SetAddress(&fSDigits);
- Int_t itrackno, idet, ism;
+ Int_t itrackno, itrackpid, idet, ism;
Int_t ixp, iyp;
Float_t edep;
Int_t nmodules = (Int_t) treeS->GetEntries();
{
pmdsdigit = (AliPMDsdigit*)fSDigits->UncheckedAt(ient);
itrackno = pmdsdigit->GetTrackNumber();
+ itrackpid = pmdsdigit->GetTrackPid();
idet = pmdsdigit->GetDetector();
ism = pmdsdigit->GetSMNumber();
ixp = pmdsdigit->GetRow();
if (fPRE[ism][ixp][iyp] < edep)
{
fPRETrackNo[ism][ixp][iyp] = troffset + itrackno;
+ fPRETrackPid[ism][ixp][iyp] = itrackpid;
}
fPRE[ism][ixp][iyp] += edep;
}
if (fCPV[ism][ixp][iyp] < edep)
{
fCPVTrackNo[ism][ixp][iyp] = troffset + itrackno;
+ fCPVTrackPid[ism][ixp][iyp] = itrackpid;
}
fCPV[ism][ixp][iyp] += edep;
}
{
// This converts the simulated edep to ADC according to the
// Test Beam Data
- //PS Test in September 2003 and 2006
+ //PS Test in May 2009, Voltage @ 1350 V
// KeV - ADC conversion for 12bit ADC
- // Modified by Ajay
-
- const Float_t kConstant = 0.07;
- const Float_t kErConstant = 0.1;
- const Float_t kSlope = 76.0;
- const Float_t kErSlope = 5.0;
+ // MPV data used for the fit and taken here
+
+ const Float_t kConstant = -0.1602;
+ const Float_t kErConstant = 0.9914;
+ const Float_t kSlope = 77.47;
+ const Float_t kErSlope = 3.16;
Float_t cons = gRandom->Gaus(kConstant,kErConstant);
Float_t slop = gRandom->Gaus(kSlope,kErSlope);
Float_t adc12bit = slop*mev*0.001 + cons;
+ if (adc12bit < 0.) adc12bit = 0.;
if(adc12bit < 1600.0)
{
}
}
//____________________________________________________________________________
-void AliPMDDigitizer::AddSDigit(Int_t trnumber, Int_t det, Int_t smnumber,
- Int_t irow, Int_t icol, Float_t adc)
+void AliPMDDigitizer::AddSDigit(Int_t trnumber, Int_t trpid, Int_t det,
+ Int_t smnumber, Int_t irow, Int_t icol,
+ Float_t adc)
{
// Add SDigit
//
if (!fSDigits) fSDigits = new TClonesArray("AliPMDsdigit", 1000);
TClonesArray &lsdigits = *fSDigits;
- new(lsdigits[fNsdigit++]) AliPMDsdigit(trnumber,det,smnumber,irow,icol,adc);
+ new(lsdigits[fNsdigit++]) AliPMDsdigit(trnumber,trpid,det,smnumber,irow,icol,adc);
}
//____________________________________________________________________________
-void AliPMDDigitizer::AddDigit(Int_t trnumber, Int_t det, Int_t smnumber,
- Int_t irow, Int_t icol, Float_t adc)
+void AliPMDDigitizer::AddDigit(Int_t trnumber, Int_t trpid, Int_t det,
+ Int_t smnumber, Int_t irow, Int_t icol,
+ Float_t adc)
{
// Add Digit
//
if (!fDigits) fDigits = new TClonesArray("AliPMDdigit", 1000);
TClonesArray &ldigits = *fDigits;
- new(ldigits[fNdigit++]) AliPMDdigit(trnumber,det,smnumber,irow,icol,adc);
+ new(ldigits[fNdigit++]) AliPMDdigit(trnumber,trpid, det,smnumber,irow,icol,adc);
}
//____________________________________________________________________________
{
for (Int_t k = 0; k < fgkCol; k++)
{
- fCPV[i][j][k] = 0.;
- fPRE[i][j][k] = 0.;
- fCPVTrackNo[i][j][k] = 0;
- fPRETrackNo[i][j][k] = 0;
+ fCPV[i][j][k] = 0.;
+ fPRE[i][j][k] = 0.;
+ fCPVTrackNo[i][j][k] = 0;
+ fPRETrackNo[i][j][k] = 0;
+ fCPVTrackPid[i][j][k] = -1;
+ fPRETrackPid[i][j][k] = -1;
}
}
}