#include "AliLog.h"
#include "AliTPCLaserTrack.h"
+#include "AliTPCROC.h"
ClassImp(AliTPCLaserTrack)
fRod(-1),
fBundle(-1),
fBeam(-1),
- fRayLength(0)
+ fRayLength(0),
+ fVecSec(0), // points vectors - sector
+ fVecP2(0), // points vectors - snp
+ fVecPhi(0), // points vectors - global phi
+ fVecGX(0), // points vectors - globalX
+ fVecGY(0), // points vectors - globalY
+ fVecGZ(0), // points vectors - globalZ
+ fVecLX(0), // points vectors - localX
+ fVecLY(0), // points vectors - localY
+ fVecLZ(0) // points vectors - localZ
{
//
// Default constructor
fRod(ltr.fRod),
fBundle(ltr.fBundle),
fBeam(ltr.fBeam),
- fRayLength(ltr.fRayLength)
+ fRayLength(ltr.fRayLength),
+ fVecSec(0), // points vectors - sector
+ fVecP2(0), // points vectors - snp
+ fVecPhi(0), // points vectors - global phi
+ fVecGX(0), // points vectors - globalX
+ fVecGY(0), // points vectors - globalY
+ fVecGZ(0), // points vectors - globalZ
+ fVecLX(0), // points vectors - localX
+ fVecLY(0), // points vectors - localY
+ fVecLZ(0) // points vectors - localZ
{
//
// Default constructor
//
+ fVecSec=new TVectorD(*ltr.fVecSec); // points vectors - sector
+ fVecP2 =new TVectorD(*ltr.fVecP2); // points vectors - snp
+ fVecPhi=new TVectorD(*ltr.fVecPhi); // points vectors - global phi
+ fVecGX =new TVectorD(*ltr.fVecGX); // points vectors - globalX
+ fVecGY =new TVectorD(*ltr.fVecGY); // points vectors - globalY
+ fVecGZ =new TVectorD(*ltr.fVecGZ); // points vectors - globalZ
+ fVecLX =new TVectorD(*ltr.fVecLX); // points vectors - localX
+ fVecLY =new TVectorD(*ltr.fVecLY); // points vectors - localY
+ fVecLZ =new TVectorD(*ltr.fVecLZ); // points vectors - localY
}
fRod(rod),
fBundle(bundle),
fBeam(beam),
- fRayLength(rayLength)
+ fRayLength(rayLength),
+ fVecSec(new TVectorD(159)), // points vectors - sector
+ fVecP2(new TVectorD(159)), // points vectors - snp
+ fVecPhi(new TVectorD(159)), // points vectors - global phi
+ fVecGX(new TVectorD(159)), // points vectors - globalX
+ fVecGY(new TVectorD(159)), // points vectors - globalY
+ fVecGZ(new TVectorD(159)), // points vectors - globalZ
+ fVecLX(new TVectorD(159)), // points vectors - localX
+ fVecLY(new TVectorD(159)), // points vectors - localY
+ fVecLZ(new TVectorD(159)) // points vectors - localZ
+
{
//
// create laser track from arguments
//
-
+
}
//_____________________________________________________________________
AliTPCLaserTrack& AliTPCLaserTrack::operator = (const AliTPCLaserTrack &source)
return *this;
}
+
+AliTPCLaserTrack::~AliTPCLaserTrack(){
+ //
+ // destructor
+ //
+ delete fVecSec; // - sector numbers
+ delete fVecP2; // - P2
+ delete fVecPhi; // points vectors - global phi
+ delete fVecGX; // points vectors - globalX
+ delete fVecGY; // points vectors - globalY
+ delete fVecGZ; // points vectors - globalZ
+ delete fVecLX; // points vectors - localX
+ delete fVecLY; // points vectors - localY
+ delete fVecLZ; // points vectors - localZ
+}
+
void AliTPCLaserTrack::LoadTracks()
{
//
// AliWarning(Form("No informatino found for Track %d!",itrack));
continue;
}
+ ltr->UpdatePoints();
fgArrLaserTracks->AddAt(new AliTPCLaserTrack(*ltr),itrack);
}
delete f;
}
+void AliTPCLaserTrack::UpdatePoints(){
+ //
+ // update track points
+ //
+ const Double_t kMaxSnp=0.99;
+ AliTPCROC* roc = AliTPCROC::Instance();
+ //
+ //
+ if (!fVecSec){
+ fVecSec=new TVectorD(159);
+ fVecP2 =new TVectorD(159); // - P2
+ fVecPhi=new TVectorD(159); // - Phi
+ fVecGX=new TVectorD(159); // points vectors - globalX
+ fVecGY=new TVectorD(159); // points vectors - globalY
+ fVecGZ=new TVectorD(159); // points vectors - globalZ
+ fVecLX=new TVectorD(159); // points vectors - localX
+ fVecLY=new TVectorD(159); // points vectors - localY
+ fVecLZ=new TVectorD(159); // points vectors - localZ
+
+ }
+ for (Int_t irow=158; irow>=0; irow--){
+ (*fVecSec)[irow]= 0; // -
+ (*fVecP2)[irow] = 0; // - P2 -snp
+ (*fVecPhi)[irow]= 0; // - global phi
+ (*fVecGX)[irow] = 0; // points vectors - globalX
+ (*fVecGY)[irow] = 0; // points vectors - globalY
+ (*fVecGZ)[irow] = 0; // points vectors - globalZ
+ (*fVecLX)[irow] = 0; // points vectors - localX
+ (*fVecLY)[irow] = 0; // points vectors - localY
+ (*fVecLZ)[irow] = 0; // points vectors - localZ
+
+ }
+ Double_t gxyz[3];
+ Double_t lxyz[3];
+ AliTPCLaserTrack*ltrp=new AliTPCLaserTrack(*this); //make temporary track
+
+ for (Int_t irow=158; irow>=0; irow--){
+ UInt_t srow = irow;
+ Int_t sector=0;
+
+ if (srow >=roc->GetNRows(0)) {
+ srow-=roc->GetNRows(0);
+ sector=36 ;
+ }
+ lxyz[0]= roc->GetPadRowRadii(sector,srow);
+ if (!ltrp->PropagateTo(lxyz[0],5)) break;
+ ltrp->GetXYZ(gxyz);
+ //
+ Double_t alpha=TMath::ATan2(gxyz[1],gxyz[0]);
+ if (alpha<0) alpha+=2*TMath::Pi();
+ sector +=TMath::Nint(-0.5+9*alpha/TMath::Pi());
+ Double_t salpha = TMath::Pi()*(sector+0.5)/9.;
+ if (!ltrp->Rotate(salpha)) break;
+ if (!ltrp->PropagateTo(lxyz[0],5)) break;
+ if (TMath::Abs(ltrp->GetSnp())>kMaxSnp) break;
+ ltrp->GetXYZ(gxyz);
+ lxyz[1]=ltrp->GetY();
+ lxyz[2]=ltrp->GetZ();
+ (*fVecSec)[irow]= sector;
+ (*fVecP2)[irow] = ltrp->GetSnp(); // - P2 -snp
+ (*fVecPhi)[irow]= TMath::ATan2(gxyz[1],gxyz[0]); // - global phi
+ (*fVecGX)[irow] = gxyz[0]; // points vectors - globalX
+ (*fVecGY)[irow] = gxyz[1]; // points vectors - globalY
+ (*fVecGZ)[irow] = gxyz[2]; // points vectors - globalZ
+ (*fVecLX)[irow] = lxyz[0]; // points vectors - localX
+ (*fVecLY)[irow] = lxyz[1]; // points vectors - localY
+ (*fVecLZ)[irow] = lxyz[2]; // points vectors - localZ
+
+ }
+ delete ltrp; // delete temporary track
+}
+
Int_t AliTPCLaserTrack::IdentifyTrack(AliExternalTrackParam *track, Int_t side)
{
//
#include <TString.h>
#include "AliExternalTrackParam.h"
+#include "TVectorD.h"
class TObjArray;
class AliTPCLaserTrack : public AliExternalTrackParam {
public:
AliTPCLaserTrack();
+ ~AliTPCLaserTrack();
AliTPCLaserTrack(const AliTPCLaserTrack <r);
AliTPCLaserTrack(const Int_t id, const Int_t side, const Int_t rod,
const Int_t bundle, const Int_t beam,
const Double_t covar[15], const Float_t rayLength=0);
AliTPCLaserTrack& operator = (const AliTPCLaserTrack &source);
-
+ void UpdatePoints(); // update track points
static void LoadTracks();
static TObjArray* GetTracks() {return fgArrLaserTracks;}
Float_t fRayLength; //distance from the last common point of the laser Rays
//(Splitter box on the A-Side at the bottom of the TPC)
//to each mirror [cm](needed for an exact drift velocity estimation)
-
-
+public:
+ TVectorD *fVecSec; // - sector numbers
+ TVectorD *fVecP2; // - P2
+ TVectorD *fVecPhi; // - global phi
+ TVectorD *fVecGX; // points vectors - globalX
+ TVectorD *fVecGY; // points vectors - globalY
+ TVectorD *fVecGZ; // points vectors - globalZ
+ TVectorD *fVecLX; // points vectors - localX
+ TVectorD *fVecLY; // points vectors - localY
+ TVectorD *fVecLZ; // points vectors - localZ
+private:
static TObjArray* fgArrLaserTracks; //! Array of all Laser Tracks,
// keeps instances of this class;
// static const char* fgkDataFileName = "$ALIC_ROOT/TPC/Calib/LaserTracks.root"; //Path to the Data File
- ClassDef(AliTPCLaserTrack,2) // Laser Track positions and track identification
+ ClassDef(AliTPCLaserTrack,3) // Laser Track positions and track identification
};
#endif