+
+
+void AliHMPIDCluster::SetClusterParams(Double_t xL,Double_t yL,Int_t iCh )
+{
+ //------------------------------------------------------------------------
+ //Set the cluster properties for the AliCluster3D part
+ //------------------------------------------------------------------------
+
+ //Get the volume ID from the previously set PNEntry
+ UShort_t volId=AliGeomManager::LayerToVolUID(AliGeomManager::kHMPID,iCh);
+
+
+ //get L->T cs matrix for a given chamber
+ const TGeoHMatrix *t2l= AliGeomManager::GetTracking2LocalMatrix(volId);
+
+ if(fParam->GetInstType()) //if there is no geometry we cannot retrieve the volId (only for monitoring)
+ {
+ new(this) AliCluster3D(); return;
+ }
+
+
+ //transformation from the pad cs to local
+ xL -= 0.5*fParam->SizeAllX(); //size of all pads with dead zones included
+ yL -= 0.5*fParam->SizeAllY();
+
+ // Get the position in the tracking cs
+ Double_t posL[3]={xL, yL, 0.}; //this is the LORS of HMPID
+ Double_t posT[3];
+ t2l->MasterToLocal(posL,posT);
+
+ //Get the cluster covariance matrix in the tracking cs
+ Double_t covL[9] = {
+ 0.8*0.8/12., 0., 0.0, //pad size X
+ 0., 0.84*0.84/12., 0.0, //pad size Y
+ 0., 0., 0.1, //just 1 , no Z dimension ???
+ };
+
+ TGeoHMatrix m;
+ m.SetRotation(covL);
+ m.Multiply(t2l);
+ m.MultiplyLeft(&t2l->Inverse());
+ Double_t *covT = m.GetRotationMatrix();
+
+ new(this) AliCluster3D(volId, // Can be done safer
+ posT[0],posT[1],posT[2],
+ covT[0],covT[1],covT[2],
+ covT[4],covT[5],
+ covT[8],
+ 0x0); // No MC labels ?
+}
+
+
+AliHMPIDCluster::~AliHMPIDCluster(){
+ if(fDigs) delete fDigs; fDigs=0;
+ }
+