****************************************************************************/
#ifndef __CINT__
- #include "alles.h"
- #include "AliMagF.h"
- #include "AliITS.h"
- #include "AliITSgeom.h"
- #include "AliITSRecPoint.h"
- #include "AliITSclusterV2.h"
- #include "AliITSsimulationFastPoints.h"
- #include "AliITStrackerV2.h"
- #include "AliTPCtrackerParam.h"
+#include <iostream.h>
+#include <TFile.h>
+#include <TStopwatch.h>
+#include <TObject.h>
+#include "alles.h"
+#include "AliRun.h"
+#include "AliHeader.h"
+#include "AliGenEventHeader.h"
+#include "AliMagF.h"
+#include "AliModule.h"
+#include "AliArrayI.h"
+#include "AliDigits.h"
+#include "AliITS.h"
+#include "AliTPC.h"
+#include "AliITSgeom.h"
+#include "AliITSRecPoint.h"
+#include "AliITSclusterV2.h"
+#include "AliITSsimulationFastPoints.h"
+#include "AliITStrackerV2.h"
+#include "AliKalmanTrack.h"
+#include "AliTPCtrackerParam.h"
#endif
typedef struct {
Int_t lab;
Int_t pdg;
+ Int_t mumlab;
Int_t mumpdg;
Float_t Vx,Vy,Vz;
Float_t Px,Py,Pz;
Int_t ITSMakeRefFile(const Char_t *galice, const Char_t *inname, const Char_t *outname, Int_t n);
Int_t AliBarrelRec_TPCparam(Int_t n=1) {
+
+ const Char_t *name=" AliBarrelRec_TPCparam";
+ cerr<<'\n'<<name<<"...\n";
+ gBenchmark->Start(name);
+
+
const Char_t *TPCtrkNameS="AliTPCtracksParam.root";
const Char_t *galiceName="galice.root";
const Char_t *ITSclsName="AliITSclustersV2.root";
AliKalmanTrack::SetConvConst(100/0.299792458/BfieldValue);
-
+
// ********** Build TPC tracks with parameterization *********** //
if (TPCParamTracks(galiceName,TPCtrkNameS,collcode,BfieldValue,n)) {
cerr<<"Failed to get TPC hits !\n";
return 1;
}
-
+
// ********** Find ITS clusters *********** //
if (ITSFindClusters(galiceName,ITSclsName,n)) {
cerr<<"Failed to get ITS clusters !\n";
return 1;
- }
+ }
+
-
// ********* Find ITS tracks *********** //
if (ITSFindTracks(galiceName,TPCtrkNameS,ITSclsName,ITStrkName,n)) {
cerr<<"Failed to get ITS tracks !\n";
return 1;
}
+ gBenchmark->Stop(name);
+ gBenchmark->Show(name);
return 0;
}
Int_t ITSFindClusters(const Char_t *inname, const Char_t *outname, Int_t n) {
-
+
cerr<<"\n*******************************************************************\n";
Int_t rc=0;
const Char_t *name="ITSFindClusters";
cerr<<'\n'<<name<<"...\n";
gBenchmark->Start(name);
+
+
+ // delete reconstruction Tree if it's there
+ TFile *f =TFile::Open(inname,"update");
+ f->Delete("TreeR0;*");
+ f->Close();
+
TFile *out=TFile::Open(outname,"recreate");
TFile *in =TFile::Open(inname,"update");
-
if (!(gAlice=(AliRun*)in->Get("gAlice"))) {
cerr<<"Can't get gAlice !\n";
out->Close();
gBenchmark->Stop(name);
gBenchmark->Show(name);
-
+
return rc;
}
const Char_t *inname2, const Char_t *outname,
Int_t n) {
-
+
cerr<<"\n*******************************************************************\n";
Int_t rc=0;
const Char_t *name="ITSFindTracks";
cerr<<'\n'<<name<<"...\n";
gBenchmark->Start(name);
-
+
TFile *out=TFile::Open(outname,"recreate");
TFile *in =TFile::Open(inname);
// setup vertex constraint in the two tracking passes
Int_t flags[2];
- flags[0]=0;
+ flags[0]=1;
tracker.SetupFirstPass(flags);
- flags[0]=-1;
+ flags[0]=0;
tracker.SetupSecondPass(flags);
rc=tracker.Clusters2Tracks(in,out);
in->Close();
in2->Close();
out->Close();
-
+
gBenchmark->Stop(name);
gBenchmark->Show(name);
AliITStrackV2 *itstrack=0;
- Int_t nparticles=gAlice->GetEvent(event);
+ gAlice->GetEvent(event);
trk->cd();
char ttname[100];
sprintf(ttname,"Tree_Ref_%d",event);
TTree *reftree = new TTree(ttname,"Tree with true track params");
- reftree->Branch("rectracks",&rectrk,"lab/I:pdg:Vx/F:Vy:Vz:Px:Py:Pz");
+ reftree->Branch("rectracks",&rectrk,"lab/I:pdg:mumlab:mumpdg:Vx/F:Vy:Vz:Px:Py:Pz");
for (Int_t i=0; i<nentr; i++) {
itstrack=new AliITStrackV2;
Part = (TParticle*)gAlice->Particle(label);
rectrk.lab=label;
rectrk.pdg=Part->GetPdgCode();
+ rectrk.mumlab = Part->GetFirstMother();
if(Part->GetFirstMother()>=0) {
Mum = (TParticle*)gAlice->Particle(Part->GetFirstMother());
rectrk.mumpdg=Mum->GetPdgCode();
trk->Close();
kin->Close();
out->Close();
-
+
gBenchmark->Stop(name);
gBenchmark->Show(name);
* appear in the supporting documentation. The authors make no claims *
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
- **************************************************************************/
-/*
-$Log$
-Revision 1.1 2002/02/18 09:06:54 kowal2
-TPC parametrization by Andrea Dainese
-
-*/
-/*************************************************************************
+ **************************************************************************
+ **************************************************************************
* *
* This class builds AliTPCtrack objects from generated tracks to feed *
* ITS tracking (V2). The AliTPCtrack is built from its first hit in *
* the TPC. The track is assigned a Kalman-like covariance matrix *
* depending on its pT and pseudorapidity and track parameters are *
- * smeared according this covariance matrix. *
+ * smeared according to this covariance matrix. *
* Output file contains sorted tracks, ready for matching with ITS *
* *
* Test macro is: AliBarrelRec_TPCparam.C *
#include "AliTPCtrack.h"
#include "TMatrixD.h"
#include "AliKalmanTrack.h"
+#include "AliMagFCM.h"
+#include "AliGausCorr.h"
+
+
+
ClassImp(AliTPCtrackerParam)
{
if(fColl!=0) {
- cerr<<"AliTPCtrackerParam::BuildTPCtracks: Invalid collision!"<<endl<<
- "Available: 0 -> PbPb6000"<<endl; return 0;
+ cerr<<"AliTPCtrackerParam::BuildTPCtracks: Invalid collision!\n
+ Available: 0 -> PbPb6000"<<endl; return 0;
}
if(fBz!=0.4) {
- cerr<<"AliTPCtrackerParam::BuildTPCtracks: Invalid field!"<<endl<<
- "Available: 0.4"<<endl; return 0;
+ cerr<<"AliTPCtrackerParam::BuildTPCtracks: Invalid field!\n
+ Available: 0.4"<<endl; return 0;
}
TFile *infile=(TFile*)inp;
- AliKalmanTrack::SetConvConst(100/0.299792458/fBz);
-
// Get gAlice object from file
if(!(gAlice=(AliRun*)infile->Get("gAlice"))) {
cerr<<"gAlice has not been found on galice.root !\n";
return 1;
}
- // Set random number generator seed
- TDatime t;
- gRandom->SetSeed(t.Get());
+ AliMagFCM *fiel = (AliMagFCM*)gAlice->Field();
+ Double_t fieval=(Double_t)fiel->SolenoidField()/10.;
+ printf("Magnetic field is %6.2f Tesla\n",fieval);
+ if(fBz!=fieval) {
+ cerr<<"AliTPCtrackerParam::BuildTPCtracks: Invalid field!"<<endl;
+ cerr<<"Field selected is: "<<fBz<<" T\n";
+ cerr<<"Field found on file is: "<<fieval<<" T\n";
+ return 0;
+ }
+
+ AliKalmanTrack::SetConvConst(100/0.299792458/fBz);
// loop over first n events in file
//-----------------------------------------------------------------
void AliTPCtrackerParam::SmearTrack(Double_t* xx,Double_t* xxsm,TMatrixD cov) {
- // build triangular matrix Bmat
- TMatrixD* Bmat = new TMatrixD(5,5);
-
- for(Int_t j=0;j<5;j++){
- Double_t accum = 0;
- for(Int_t k=0;k<j;k++){
- accum += (*Bmat)(j,k)* (*Bmat)(j,k);
- }
- (*Bmat)(j,j)=TMath::Sqrt(TMath::Abs(cov(j,j)-accum));
- for(Int_t i=j+1;i<5;i++){
- accum = 0;
- for(Int_t k=0;k<j;k++){
- accum+=(*Bmat)(i,k)* (*Bmat)(j,k);
- }
- (*Bmat)(i,j) = (cov(i,j)-accum) / (*Bmat)(j,j);
- }
- }
-
- // get array of numbers with normal distribution
- TArrayD norm;
- norm.Set(5);
- for(Int_t l=0;l<5;l++) {
- norm[l]=gRandom->Gaus();
- }
-
- // use Bmat matrix to generate correlated numbers
- TArrayD corr;
- corr.Set(5);
- for(Int_t i=0;i<5;i++){
- corr[i]=0;
- for(Int_t j=0;j<=i;j++) corr[i] += (*Bmat)(i,j)*norm[j];
- }
-
- delete Bmat;
+ AliGausCorr *corgen = new AliGausCorr(cov,5);
+ TArrayD corr(5);
+ corgen->GetGaussN(corr);
+ delete corgen;
+ corgen = 0;
for(Int_t l=0;l<5;l++) {
xxsm[l] = xx[l]+corr[l];
// open file with matrixes DB
TFile* DBfile = new TFile(s->Data());
- AliTPCtrack* track=new AliTPCtrack;
+ AliTPCtrack* track = 0;
Int_t entr = (Int_t)tarray.GetEntriesFast();
for(Int_t k=0; k<entr; k++) {
// fill the array
newtarray.AddLast(tpctrack);
-
+
+ delete matrix;
+
}
DBfile->Close();
+ delete s;
+ delete DBfile;
+
+
return;
}
//-----------------------------------------------------------------
#define ALITPCTRACKERPARAM_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. */
/* See cxx source for full Copyright notice */
-/* $Id$ */
//-----------------------------------------------------------------------------
// TPC Tracking Parameterization Class
//
//-----------------------------------------------------------------------------
#include "alles.h"
#include "AliMagF.h"
+#include "AliGausCorr.h"
#include "AliTPCtrack.h"
class AliTPCtrackerParam {