#include <TNtuple.h>
#include <TParticle.h>
+#include <TGeoMatrix.h>
+
+#include "AliGeomManager.h"
+
#include "AliPMDcluster.h"
#include "AliPMDclupid.h"
#include "AliPMDrecpoint1.h"
// algorithm on CPV plane and PREshower plane
//
- Int_t idet;
- Int_t ismn;
- Int_t trackno, trackpid;
- Float_t clusdata[6];
+ Int_t idet = 0;
+ Int_t ismn = 0;
+ Int_t trackno = 1, trackpid = 0;
+ Float_t clusdata[6] = {0.,0.,0.,0.,0.,0.};
Int_t *irow;
Int_t *icol;
ipid = new Int_t[nenbr1];
cadc = new Float_t[nenbr1];
+ for (Int_t ient1 = 0; ient1 < nenbr1; ient1++)
+ {
+ irow[ient1] = -99;
+ icol[ient1] = -99;
+ itra[ient1] = -99;
+ ipid[ient1] = -99;
+ cadc[ient1] = 0.;
+ }
for (Int_t ient1 = 0; ient1 < nenbr1; ient1++)
{
rechit = (AliPMDrechit*)fRechits->UncheckedAt(ient1);
}
}
- AliPMDDiscriminator *pmddiscriminator = new AliPMDEmpDiscriminator();
- pmddiscriminator->Discrimination(fPMDcontin,fPMDcontout);
+ AliPMDEmpDiscriminator pmddiscriminator;
+ pmddiscriminator.Discrimination(fPMDcontin,fPMDcontout);
+
+ // alignment implemention
+
+ Double_t sectr[4][3] = { {0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}};
+ TString snsector="PMD/Sector";
+ TString symname;
+ TGeoHMatrix gpmdor;
+
+ for(Int_t isector=1; isector<=4; isector++)
+ {
+ symname = snsector;
+ symname += isector;
+ TGeoHMatrix *gpmdal = AliGeomManager::GetMatrix(symname);
+ Double_t *tral = gpmdal->GetTranslation();
+
+ AliGeomManager::GetOrigGlobalMatrix(symname, gpmdor);
+ Double_t *tror = gpmdor.GetTranslation();
+
+ for(Int_t ixyz=0; ixyz<3; ixyz++)
+ {
+ sectr[isector-1][ixyz] = tral[ixyz] - tror[ixyz];
+ }
+ }
const Float_t kzpos = 361.5; // middle of the PMD
- Int_t det,smn,trno,trpid,mstat;
- Float_t xpos,ypos;
- Float_t adc, ncell, radx, rady;
+ Int_t ix = -1, iy = -1;
+ Int_t det = 0, smn = 0, trno = 1, trpid = 0, mstat = 0;
+ Float_t xpos = 0., ypos = 0.;
+ Float_t adc = 0., ncell = 0., radx = 0., rady = 0.;
Float_t xglobal = 0., yglobal = 0., zglobal = 0;
- Float_t pid;
+ Float_t pid = 0.;
+ fPMDutil->ApplyAlignment(sectr);
Int_t nentries2 = fPMDcontout->GetEntries();
AliDebug(1,Form("Number of clusters coming after discrimination = %d"
adc = fPMDclout->GetClusADC();
ncell = fPMDclout->GetClusCells();
radx = fPMDclout->GetClusSigmaX();
- rady = fPMDclout->GetClusSigmaY();
+ // Here in the variable "rady" we are keeping the row and col
+ // of the single isolated cluster having ncell = 1 for offline
+ // calibration
+
+ if ((radx > 999. && radx < 1000.) && ncell == 1)
+ {
+ if (smn < 12)
+ {
+ ix = (Int_t) (ypos +0.5);
+ iy = (Int_t) xpos;
+ }
+ else if (smn > 12 && smn < 24)
+ {
+ ix = (Int_t) xpos;
+ iy = (Int_t) (ypos +0.5);
+ }
+ rady = (Float_t) (ix*100 + iy);
+ }
+ else
+ {
+ rady = fPMDclout->GetClusSigmaY();
+ }
pid = fPMDclout->GetClusPID();
//
**********************************************************************/
//
- fPMDutil->RectGeomCellPos(smn,xpos,ypos,xglobal,yglobal);
if (det == 0)
{
- zglobal = kzpos + 1.6; // PREshower plane
+ zglobal = kzpos + 1.65; // PREshower plane
}
else if (det == 1)
{
- zglobal = kzpos - 1.7; // CPV plane
+ zglobal = kzpos - 1.65; // CPV plane
}
+ fPMDutil->RectGeomCellPos(smn,xpos,ypos,xglobal,yglobal,zglobal);
+
// Fill ESD
AliESDPmdTrack *esdpmdtr = new AliESDPmdTrack();
esdpmdtr->SetClusterSigmaY(rady);
event->AddPmdTrack(esdpmdtr);
+ delete esdpmdtr;
}
fPMDcontin->Delete();
// split cluster part will be done at the time of calculating eff/pur
Int_t *phentry = new Int_t [nentry];
- Int_t *trenergy = 0x0;
+ Int_t *hadentry = new Int_t [nentry];
+ Int_t *trpid = 0x0;
Int_t *sortcoord = 0x0;
+ Float_t *trenergy = 0x0;
Int_t ngtrack = 0;
+ Int_t nhtrack = 0;
for (Int_t i = 0; i < nentry; i++)
{
phentry[i] = -1;
+ hadentry[i] = -1;
+
if (ipid[i] == 22)
{
phentry[ngtrack] = i;
ngtrack++;
}
+ else if (ipid[i] != 22)
+ {
+ hadentry[nhtrack] = i;
+ nhtrack++;
+ }
}
+ Int_t nghadtrack = ngtrack + nhtrack;
+
if (ngtrack == 0)
{
// hadron track
trackpid = 8;
trackno = -1;
}
- else if (ngtrack == 1)
- {
- // only one photon track
- // track number set to photon track
- trackpid = 1;
- trackno = itra[phentry[0]];
- }
- else if (ngtrack > 1)
+ else if (ngtrack >= 1)
{
- // more than one photon track
-
- trenergy = new Int_t [ngtrack];
- sortcoord = new Int_t [ngtrack];
+ // one or more than one photon track + charged track
+ // find out which track deposits maximum energy and
+ // assign that track number and track pid
+
+ trenergy = new Float_t [nghadtrack];
+ trpid = new Int_t [nghadtrack];
+ sortcoord = new Int_t [2*nghadtrack];
for (Int_t i = 0; i < ngtrack; i++)
{
trenergy[i] = 0.;
+ trpid[i] = -1;
for (Int_t j = 0; j < nentry; j++)
{
if (ipid[j] == 22 && itra[j] == itra[phentry[i]])
{
trenergy[i] += cadc[j];
+ trpid[i] = 22;
+ }
+ }
+ }
+ for (Int_t i = ngtrack; i < nghadtrack; i++)
+ {
+ trenergy[i] = 0.;
+ trpid[i] = -1;
+ for (Int_t j = 0; j < nentry; j++)
+ {
+ if (ipid[j] != 22 && itra[j] == itra[hadentry[i-ngtrack]])
+ {
+ trenergy[i] += cadc[j];
+ trpid[i] = ipid[j];
}
}
}
Bool_t jsort = true;
- TMath::Sort(ngtrack,trenergy,sortcoord,jsort);
+ TMath::Sort(nghadtrack,trenergy,sortcoord,jsort);
Int_t gtr = sortcoord[0];
- trackno = itra[phentry[gtr]]; // highest adc track
- trackpid = 1;
+ if (trpid[gtr] == 22)
+ {
+ trackpid = 22;
+ trackno = itra[phentry[gtr]]; // highest adc track
+ }
+ else
+ {
+ trackpid = 8;
+ trackno = -1;
+ }
delete [] trenergy;
+ delete [] trpid;
delete [] sortcoord;
- } // end of ngtrack > 1
+ } // end of ngtrack >= 1
+
+ delete [] phentry;
+ delete [] hadentry;
}
//--------------------------------------------------------------------//