Float_t xyz[3];
Float_t fpad=(Float_t)list[j].fPad/(Float_t)list[j].fTotalCharge;
Float_t ftime=(Float_t)list[j].fTime/(Float_t)list[j].fTotalCharge;
+
//cout<<"WriteCluster: padrow "<<fCurrentRow<<" pad "<<fpad<<" time "<<ftime<<" charge "<<list[j].fTotalCharge<<endl;
- //printf("padrow %d number of pads %d totalcharge %d\n",fCurrentRow,list[j].fFlags,list[j].fTotalCharge);
AliL3Transform::Slice2Sector(fCurrentSlice,fCurrentRow,thissector,thisrow);
AliL3Transform::Raw2Local(xyz,thissector,thisrow,fpad,ftime);
if(xyz[0]==0) LOG(AliL3Log::kError,"AliL3ClustFinder","Cluster Finder")
#ifdef do_mc
Int_t trackID[3];
GetTrackID((Int_t)rint(fpad),(Int_t)rint(ftime),trackID);
- //cout<<"padrow "<<fCurrentRow<<" pad "<<(Int_t)rint(fpad)<<" time "<<(Int_t)rint(ftime)<<" Trackid "<<trackID[0]<<endl;
+ cout<<"padrow "<<fCurrentRow<<" pad "<<(Int_t)rint(fpad)<<" time "<<(Int_t)rint(ftime)<<" Trackid "<<trackID[0]<<endl;
fSpacePointData[counter].fTrackID[0] = trackID[0];
fSpacePointData[counter].fTrackID[1] = trackID[1];
fSpacePointData[counter].fTrackID[2] = trackID[2];
fNumRowSegment = fRowMax - fRowMin; //number of rows to be considered by tracker
LOG(AliL3Log::kInformational,"AliL3ConfMapper::InitSector","B-field")
- <<"Tracker initializing assuming magnetic field of "<<AliL3Transform::GetBField()<<ENDLOG;
+ <<"Tracker initializing with a magnetic field of "<<AliL3Transform::GetBField()<<ENDLOG;
fTrack->Reset();
}
fTracks = NULL;
}
-AliL3Display::AliL3Display(Int_t *slice)
+AliL3Display::AliL3Display(Int_t *slice,Char_t *gfile)
{
//Ctor. Specify which slices you want to look at.
- TFile *file = new TFile("$(LEVEL3)/GEO/alice.geom");
+ TFile *file = new TFile(gfile);
if(!file) printf("NO FILE\n");
if(!file->IsOpen())
LOG(AliL3Log::kError,"AliL3Display::AliL3Display","File Open")
- <<"Geometry file alice.geom does not exist"<<ENDLOG;
+ <<"Geometry file " << gfile << " does not exist"<<ENDLOG;
fGeom = (TGeometry*)file->Get("AliceGeom");
fMinSlice = slice[0];
}
-void AliL3Display::DisplayTracks(Int_t min_hits)
+void AliL3Display::DisplayTracks(Int_t min_hits,Bool_t x3don)
{
//Display the found tracks.
TView *v = new TView(1);
v->SetRange(-430,-560,-430,430,560,1710);
-
c1->Clear();
c1->SetFillColor(1);
c1->SetTheta(90.);
*/
fGeom->Draw("same");
- c1->x3d();
+ if(x3don) c1->x3d();
}
-void AliL3Display::DisplayClusters()
+void AliL3Display::DisplayClusters(Bool_t x3don)
{
//Display all clusters.
TCanvas *c1 = new TCanvas("c1","",700,700);
c1->cd();
+
TView *v = new TView(1);
v->SetRange(-430,-560,-430,430,560,1710);
c1->Clear();
}
fGeom->Draw("same");
- c1->x3d();
+ if(x3don) c1->x3d();
}
-void AliL3Display::DisplayAll(Int_t min_hits)
+void AliL3Display::DisplayAll(Int_t min_hits,Bool_t x3don)
{
//Display tracks & all hits.
-
TCanvas *c1 = new TCanvas("c1","",700,700);
c1->cd();
TView *v = new TView(1);
Float_t ycl[176];
Float_t zcl[176];
-
for(Int_t j=0; j<ntracks; j++)
{
AliL3Track *gtrack = fTracks->GetCheckedTrack(j);
current_line->Draw("same");
}
-
Char_t fname[256];
Int_t i;
Int_t color = 1;
fGeom->Draw("same");
- c1->x3d();
-
+ if(x3don) c1->x3d();
}
-
void AliL3Display::DisplayClusterRow(Int_t slice,Int_t padrow,Char_t *digitsFile,Char_t *type)
{
//Display the found clusters on this row together with the raw data.
public:
AliL3Display();
- AliL3Display(Int_t *slice);
+ AliL3Display(Int_t *slice, Char_t *gfile="$(LEVEL3)/GEO/alice.geom");
virtual ~AliL3Display();
void Setup(Char_t *trackfile,Char_t *path);
- void DisplayTracks(Int_t min_hits=10);
- void DisplayAll(Int_t min_hits=10);
- void DisplayClusters();
+ void DisplayTracks(Int_t min_hits=10,Bool_t x3don=kTRUE);
+ void DisplayAll(Int_t min_hits=10,Bool_t x3don=kTRUE);
+ void DisplayClusters(Bool_t x3don=kTRUE);
void DisplayClusterRow(Int_t slice,Int_t padrow,Char_t *digitsFile,Char_t *type="hist");
void SetTracks(AliL3TrackArray *tracks) {fTracks=tracks;}
{
//ctor to use if you do not need any rootfile.
-
fMinSlice = slice[0];
fMaxSlice = slice[1];
-
}
AliL3Evaluate::~AliL3Evaluate()
void AliL3Evaluate::Setup(Char_t *trackfile,Char_t *path)
{
//Read in the hit and track information from produced files.
+ AliL3Transform::Init(path);
fGoodFound = 0;
fGoodGen = 0;
void AliL3Evaluate::SetupSlow(Char_t *trackfile,Char_t *digitsfile,Char_t *path)
{
//Setup for using the slow simulator.
+ AliL3Transform::Init(path);
fDigitsFile = new TFile(digitsfile,"READ");
if(!fDigitsFile->IsOpen())
void AliL3Evaluate::SetupFast(Char_t *trackfile,Char_t *mcClusterfile,Char_t *path)
{
//Setup for using the fast simulator.
+ AliL3Transform::Init(path);
fIsSlow = false;
GetFastClusterIDs(path);
}
-
-
void AliL3Evaluate::DefineGoodTracks(Int_t *slice,Int_t *padrow,Int_t good_number,Char_t *fname)
{
//Loop over MC particles, and mark the good ones
}
-
Int_t **AliL3Evaluate::GetClusterIDs(AliL3Track *track)
{
//Return the MC information of all clusters belonging to track.
fFakeTrackEffEta = new TH1F("fFakeTrackEffEta","Efficiency for fake tracks vs eta",20,-50,50);
printf("finished creating histos\n");
}
+
/*
void AliL3Evaluate::FillEffHistos()
{
}
}
*/
+
void AliL3Evaluate::FillEffHistos()
{
//Fill the efficiency histograms.
{
//Calcluate the crossing point between a generated particle and given padrow.
-
- Double_t kappa = 0.2*0.0029980/part->Pt();
+ Double_t Pi = AliL3Transform::Pi();
+ Double_t kappa = AliL3Transform::GetBField()*0.0029980/part->Pt();
Double_t radius = 1/fabs(kappa);
if(part->GetPdgCode() > 0) kappa = -kappa;
if(fDPt) delete [] fDPt;
}
+void AliL3MemHandler::Init(Int_t s,Int_t p, Int_t *r=0)
+{
+ fSlice=s;fPatch=p;
+ if(r) {
+ fRowMin=r[0];
+ fRowMax=r[1];
+ }else{
+ fRowMin=AliL3Transform::GetFirstRow(p);
+ fRowMax=AliL3Transform::GetLastRow(p);
+ }
+ ResetROI();
+}
+
void AliL3MemHandler::ResetROI()
{
//Resets the Look-up table for Region of Interest mode.
}
}
-
void AliL3MemHandler::SetROI(Float_t *eta,Int_t *slice)
{
// Init the Look-up table for the Region of Interest mode.
virtual ~AliL3MemHandler();
void Reset(){CloseBinaryInput();CloseBinaryOutput();Free();}
- void Init(Int_t s,Int_t p){fSlice=s;fPatch=p;fRowMin=AliL3Transform::GetFirstRow(p);fRowMax=AliL3Transform::GetLastRow(p); ResetROI();}
+ void Init(Int_t s,Int_t p, Int_t *r=0);
Bool_t SetBinaryInput(char *name);
Bool_t SetBinaryInput(FILE *file);
SetTgl(tpt->GetTgl());
SetCharge(tpt->GetCharge());
SetHits(tpt->GetNHits(),(UInt_t *)tpt->GetHitNumbers());
-
}
Int_t AliL3Track::Compare(const AliL3Track *track) const
{
// Returns total momentum.
return fabs(GetPt())*sqrt(1. + GetTgl()*GetTgl());
-
}
Double_t AliL3Track::GetPseudoRapidity() const
{
return 0.5 * log((GetP() + GetPz()) / (GetP() - GetPz()));
}
+
/*
Double_t AliL3Track::GetEta() const
{
return GetPseudoRapidity();
}
*/
+
Double_t AliL3Track::GetRapidity() const
{
Double_t m_pi = 0.13957;
}
void AliL3Track::CalculateHelix(){
- //Calculate Radius, CenterX and Centery from Psi, X0, Y0
+ //Calculate Radius, CenterX and CenterY from Psi, X0, Y0
//
fRadius = fPt / (BFACT*AliL3Transform::GetBField());
Bool_t AliL3Track::CalculateReferencePoint(Double_t angle,Double_t radius){
// Global coordinate: crossing point with y = ax+ b; a=tan(angle-AliL3Transform::Pi()/2);
//
- const Double_t rr=radius;//132; //position of referece plane
- const Double_t xr = cos(angle) *rr;
- const Double_t yr = sin(angle) *rr;
+ const Double_t rr=radius;//132; //position of reference plane
+ const Double_t xr = cos(angle) * rr;
+ const Double_t yr = sin(angle) * rr;
Double_t a = tan(angle-pi/2);
Double_t b = yr - a * xr;
Int_t fNHits;
Int_t fMCid; //Assigned id from MC data.
- Double_t fKappa; // Curvature
- Double_t fRadius; // Radius of the helix (projected to a circle)
- Double_t fCenterX; // x coordinate of the center of the helix (projected to a circle)
- Double_t fCenterY; // y coordinate of the center of the helix (projected to a circle)
+
+ Double_t fKappa; // Signed curvature (projected to a circle)
+ Double_t fRadius; // Radius of the helix (projected to a circle)
+ Double_t fCenterX; // x coordinate of the center of the helix (projected to a circle)
+ Double_t fCenterY; // y coordinate of the center of the helix (projected to a circle)
Bool_t fFromMainVertex; // true if tracks origin is the main vertex, otherwise false
Int_t fRowRange[2]; //Subsector where this track was build
Int_t fQ; //charge measured fit
//track parameters:
- Double_t fPhi0; //azimuthal angle of the first point
- Double_t fPsi; //azimuthal angle of the momentum
- Double_t fR0; //radius of the first point
- Double_t fTanl; //tan of dipangle at (r,phi,z)
- Double_t fZ0; //z coordinate of the first point
- Double_t fPt; //transverse momentum
- Double_t fLength;
+ Double_t fTanl; //tan of dipangle
+ Double_t fPsi; //azimuthal angle of the momentum
+ Double_t fPt; //transverse momentum
+ Double_t fLength; //length of track (s)
Double_t fPterr;
Double_t fPsierr;
Double_t fZ0err;
Double_t fTanlerr;
+ Double_t fPhi0; //azimuthal angle of the first point
+ Double_t fR0; //radius of the first point
+ Double_t fZ0; //z coordinate of the first point (fFirstPoint[2])
+
Double_t fFirstPoint[3];
Double_t fLastPoint[3];
Double_t fPoint[3];
Double_t fPointPsi; //azimuthal angle of the momentum at Point
+
+
Bool_t fIsPoint; //Helix crosses the X-plane
Bool_t IsPoint(Bool_t ispoint) {fIsPoint = ispoint;return fIsPoint;}
Bool_t CalculateReferencePoint(Double_t angle,Double_t radius=132);//Calculate Reference Point
Bool_t CalculateEdgePoint(Double_t angle);//Calculate crossing point with line
- Bool_t CalculatePoint(Double_t xplane);//Calculate crossing point with X-plane
+ Bool_t CalculatePoint(Double_t xplane); //Calculate crossing point with X-plane
Bool_t IsPoint() {return fIsPoint;}
Double_t GetCrossingAngle(Int_t padrow);
Bool_t GetCrossingPoint(Int_t padrow,Float_t *xyz);
Double_t GetPt() const {return fPt;}
Double_t GetTgl() const {return fTanl;}
- Double_t GetPhi0() const {return fPhi0;}
Double_t GetPsi() const {return fPsi;}
+ Double_t GetPhi0() const {return fPhi0;}
Double_t GetR0() const {return fR0;}
Double_t GetZ0() const {return fFirstPoint[2];}
//Double_t GetZ0() const {return fZ0;}
- Double_t GetKappa() const { return fKappa;}
- Double_t GetRadius() const { return fRadius;}
- Double_t GetCenterX() const { return fCenterX;}
- Double_t GetCenterY() const { return fCenterY;}
+ Double_t GetKappa() const {return fKappa;}
+ Double_t GetRadius() const {return fRadius;}
+ Double_t GetCenterX() const {return fCenterX;}
+ Double_t GetCenterY() const {return fCenterY;}
Int_t GetNHits() const {return fNHits;}
Int_t GetNumberOfPoints() const {return fNHits;}
- Bool_t ComesFromMainVertex() const { return fFromMainVertex;}
+ Bool_t ComesFromMainVertex() const {return fFromMainVertex;}
- Double_t GetPx() const { return fPt*cos(fPsi);}
- Double_t GetPy() const { return fPt*sin(fPsi);}
- Double_t GetPz() const { return fPt*fTanl;}
+ Double_t GetPx() const {return fPt*cos(fPsi);}
+ Double_t GetPy() const {return fPt*sin(fPsi);}
+ Double_t GetPz() const {return fPt*fTanl;}
- Double_t GetP() const;
- Double_t GetPseudoRapidity() const;
+ Double_t GetP() const;
+ Double_t GetPseudoRapidity() const;
//Double_t GetEta() const;
Double_t GetRapidity() const;
- Int_t GetCharge() const { return fQ;}
+ Int_t GetCharge() const {return fQ;}
Int_t GetMCid() const {return fMCid;}
- Double_t GetLength() const {return fLength;}
+ Double_t GetLength() const {return fLength;}
- Int_t GetFirstRow() const {return fRowRange[0];}
+ Int_t GetFirstRow() const {return fRowRange[0];}
Int_t GetLastRow() const {return fRowRange[1];}
UInt_t *GetHitNumbers() {return fHitNumbers;}
void SetNHits(Int_t f) {fNHits = f;}
- void SetRowRange(Int_t f,Int_t g) {fRowRange[0]=f; fRowRange[1]=g;}
- void SetSector(Int_t f) {fSector = f;}
+ void SetRowRange(Int_t f,Int_t g) {fRowRange[0]=f; fRowRange[1]=g;}
+ void SetSector(Int_t f) {fSector = f;}
- void SetRadius(Double_t f) { fRadius = f; }
- void SetCenterX(Double_t f) { fCenterX = f; }
- void SetCenterY(Double_t f) { fCenterY = f; }
+ void SetRadius(Double_t f) {fRadius = f;}
+ void SetCenterX(Double_t f) {fCenterX = f;}
+ void SetCenterY(Double_t f) {fCenterY = f;}
- void SetCharge(Int_t f) { fQ = f; }
+ void SetCharge(Int_t f) {fQ = f;}
- void ComesFromMainVertex(Bool_t f) { fFromMainVertex = f; }
+ void ComesFromMainVertex(Bool_t f) {fFromMainVertex = f;}
ClassDef(AliL3Track,1) //Base track class
};
#endif
-
+
}
void AliL3TrackMerger::SetRows(Int_t *row){
- for(Int_t i =0;i<fNSubSector;i++){
+ for(Int_t i=0;i<fNSubSector;i++){
fRowMin[i]=*(row+(2*i));
fRowMax[i]=*(row+(2*i+1));
}
AliL3Transform::Init(path);//Initialize the detector parameters.
fWriteOut = kFALSE;
- fGlobalMerger=0;
+ fUseBinary = binary;
+ SetPath(path);
+ fGlobalMerger = 0;
+
fDoRoi = kFALSE;
fDoNonVertex = kFALSE;
- fClusterDeconv = kTRUE;
+ fFindVertex = kFALSE;
+ SetClusterFinderParam();
+
fEta[0] = 0.;
fEta[1] = 0.9;
- fUseBinary = binary;
- SetPath(path);
- fFindVertex =kFALSE;
+
fEvent=0;
switch(npatches){
fRow[4][0] = 142;
fRow[4][1] = 175; // last row
break;
- default:
+ default: //should match entries in AliL3Transform
fNPatch = 6; //number of patches change row in process
fRow[0][0] = 0; // first row
fRow[0][1] = 31;
AliLevel3::~AliLevel3(){
//Destructor
- if(fVertexFinder) delete fVertexFinder;
- if(fVertex) delete fVertex;
+ if(fVertexFinder) delete fVertexFinder;
+ if(fVertex) delete fVertex;
if(fTracker) delete fTracker;
if(fTrackMerger) delete fTrackMerger;
if(fInterMerger) delete fInterMerger;
if(fFileHandler) delete fFileHandler;
}
+void AliLevel3::SetClusterFinderParam(Float_t fXYError, Float_t fZError, Bool_t deconv)
+{
+ fXYClusterError=fXYError;
+ fZClusterError=fZError;
+ fClusterDeconv=deconv;
+}
+
void AliLevel3::SetTrackerParam(Int_t phi_segments, Int_t eta_segments,
Int_t trackletlength, Int_t tracklength,
Int_t rowscopetracklet, Int_t rowscopetrack,
void AliLevel3::ProcessEvent(Int_t first,Int_t last,Int_t event){
//Do tracking on all slices in region [first,last]
- //Slices numbering in TPC goes from 0-35, which means that 1 slice
+ //Slices numbering in TPC goes from 0-35, which means that one slice
//corresponds to inner+outer sector.E.g. slice 2 corresponds to
//inner=2 + outer=38.
fGlobalMerger= new AliL3GlobalMerger(first,last);
const Int_t maxpoints=100000;
const Int_t pointsize = maxpoints * sizeof(AliL3SpacePointData);
AliL3MemHandler *memory = new AliL3MemHandler();
-
+
fTrackMerger->Reset();
fTrackMerger->SetRows(fRow[0]);
for(Int_t patch=fNPatch-1;patch>=0;patch--){
- fFileHandler->Init(slice,patch);
+ fFileHandler->Init(slice,patch,&fRow[patch][0]);
UInt_t npoints=0;
AliL3SpacePointData *points =0;
UInt_t ndigits=0;
points = (AliL3SpacePointData *) memory->Allocate(pointsize);
fClusterFinder = new AliL3ClustFinderNew();
- fClusterFinder->InitSlice(slice,patch,fRow[patch][0],fRow[patch][1]
- ,maxpoints);
+ fClusterFinder->InitSlice(slice,patch,fRow[patch][0],fRow[patch][1],maxpoints);
fClusterFinder->SetDeconv(fClusterDeconv);
- fClusterFinder->SetXYError(0.2);
- fClusterFinder->SetZError(0.3);
+ fClusterFinder->SetXYError(fXYClusterError);
+ fClusterFinder->SetZError(fZClusterError);
fClusterFinder->SetOutputArray(points);
fClusterFinder->Read(ndigits,digits);
fBenchmark->Start("Cluster Finder");
fFileHandler->Free();
LOG(AliL3Log::kInformational,"AliLevel3::ProcessSlice","Cluster Finder")
<<AliL3Log::kDec<<"Found "<<npoints<<" Points"<<ENDLOG;
-
-
}//end UseCF
else{// if not use Clusterfinder
if(fUseBinary){//Binary to Memory
delete memory;
}
-
Int_t AliLevel3::WriteTracks(char *filename,AliL3Merger *merger,char opt){
AliL3MemHandler *memory = new AliL3MemHandler();
memory->SetBinaryOutput(filename);
class AliL3ClustFinderNew;
class AliL3Merger;
class AliL3InterMerger;
+
#ifdef use_aliroot
class AliL3FileHandler;
#else
AliL3GlobalMerger *fGlobalMerger; //!
AliL3InterMerger *fInterMerger; //!
AliL3ClustFinderNew *fClusterFinder; //!
- #ifdef use_aliroot
+#ifdef use_aliroot
AliL3FileHandler *fFileHandler; //!
- #else
+#else
AliL3MemHandler *fFileHandler; //!
- #endif
+#endif
AliL3Benchmark *fBenchmark;//!
+
+ Int_t fEvent;
Int_t fNPatch;
Int_t fRow[6][2];
- Char_t fPath[256];
- Char_t fWriteOutPath[256];
+ Float_t fEta[2];
+
TDirectory *savedir;
TFile *fInputFile;
+ Char_t fPath[256];
+ Char_t fWriteOutPath[256];
+
+ Bool_t fDoRoi;
Bool_t fFindVertex;
Bool_t fDoNonVertex;
+
+ Bool_t fUseBinary;
+ Bool_t fWriteOut;
+
+ Float_t fXYClusterError;
+ Float_t fZClusterError;
Bool_t fClusterDeconv;
- Int_t fEvent;
- //void Init(Int_t npatches=6);
+
void WriteSpacePoints(UInt_t npoints,AliL3SpacePointData *points,
- Int_t slice,Int_t patch);
+ Int_t slice,Int_t patch);
void WriteResults();
Int_t WriteTracks(char *filename,AliL3Merger *merger,char opt='o');
- Float_t fEta[2];
- Bool_t fDoRoi;
- Bool_t fUseBinary;
- Bool_t fWriteOut;
void SetPath(char *p){sprintf(fPath,"%s",p);}
+
public:
AliLevel3 ();
AliLevel3(Char_t *infile);
Double_t min_pt_fit=0,Double_t maxangle=1.31,
Double_t goodDist=5,Double_t hitChi2Cut=10,
Double_t goodHitChi2=20,Double_t trackChi2Cut=50,
- Int_t maxdist=50,Double_t maxphi=0.1,Double_t maxeta=0.1,Bool_t vertexconstraint=kTRUE);
-
+ Int_t maxdist=50,Double_t maxphi=0.1,Double_t maxeta=0.1,
+ Bool_t vertexconstraint=kTRUE);
+ void SetClusterFinderParam(Float_t fXYError=0.2,Float_t fZError=0.3,Bool_t deconv=kTRUE);
void ProcessEvent(Int_t first,Int_t last,Int_t event=0);
void ProcessSlice(Int_t slice);
- //void UseBinaryInput(char *path){SetPath(path);fUseBinary=kTRUE;}
void DoMc(char* file="point_mc.dat");
void DoNonVertexTracking() {fDoNonVertex=kTRUE;}
void FindVertex() {fFindVertex=kTRUE;}
void DoBench(char* name="benchmark");
void DoRoi(Float_t e0=0.4,Float_t e1=0.5){fEta[0]=e0;fEta[1]=e1;fDoRoi=kTRUE;}
void WriteFiles(Char_t *path="./"){fWriteOut = kTRUE; sprintf(fWriteOutPath,"%s",path);}
+ //void UseBinaryInput(char *path){SetPath(path);fUseBinary=kTRUE;}
+
ClassDef(AliLevel3,1) //Interface class for Level3-tracking
};
AliL3Vertex.cxx AliL3VertexFinder.cxx \
AliL3Merger.cxx AliL3GlobalMerger.cxx AliL3ClustFinderNew.cxx \
AliL3TrackArray.cxx AliL3InterMerger.cxx AliL3Logger.cxx \
- AliL3MemHandler.cxx AliL3Benchmark.cxx AliL3Display.cxx
+ AliL3MemHandler.cxx AliL3Benchmark.cxx AliL3Display.cxx\
+ AliL3Evaluate.cxx
DICT = AliL3Cint.cxx
DICTH = AliL3Cint.h