, fNmaxEvents(-1)
, fTime0(-1)
, fCreateT0seed(kFALSE)
+, fLongT0seed(kTRUE)
+, fFillClusterRes(kFALSE)
, fStreamer(0x0)
, fInputFile(0x0)
, fTree(0x0)
gROOT->cd();
- static AliExternalTrackParam dummySeedT0;
- static AliExternalTrackParam dummySeed;
- static AliExternalTrackParam dummyTrack;
+ static AliExternalTrackParam resetParam;
AliExternalTrackParam t0seed;
AliExternalTrackParam seed;
AliExternalTrackParam track;
- AliExternalTrackParam trackITS;
AliExternalTrackParam tOrig;
- AliExternalTrackParam tOrigITS;
+ // at ITS
+ AliExternalTrackParam tOrigITS; // ideal track
+ AliExternalTrackParam tRealITS; // ITS track with realistic space point resolution
+ AliExternalTrackParam trackITS; // TPC refitted track
+
+ //between TPC inner wall and ITS
+ AliExternalTrackParam tOrigITS1;
+ AliExternalTrackParam tRealITS1;
+ AliExternalTrackParam trackITS1;
+
+ //at TPC inner wall
+ AliExternalTrackParam tOrigITS2;
+ AliExternalTrackParam tRealITS2;
+ AliExternalTrackParam trackITS2;
+
AliExternalTrackParam *dummy;
+
+ //
+ TClonesArray *arrClustRes=0x0;
+ if (fFillClusterRes){
+ arrClustRes=new TClonesArray("AliTPCclusterMI",160);
+ }
Int_t maxev=fTree->GetEntries();
if (nmaxEv>0&&nmaxEv<maxev) maxev=nmaxEv;
+
+ const Double_t lastLayerITS = 43.0; // same as in AliToyMCEventGenerator::MakeITSClusters (hard coded)
+ const Double_t iFCRadius = 83.5; //radius constants found in AliTPCCorrection.cxx
+ const Double_t betweeTPCITS = (lastLayerITS+iFCRadius)/2.; // its track propgated to inner TPC wall
+
+ const Double_t kMaxSnp = 0.85;
+ const Double_t kMass = TDatabasePDG::Instance()->GetParticle("pi+")->Mass();
+
for (Int_t iev=0; iev<maxev; ++iev){
printf("============== Processing Event %6d =================\n",iev);
// printf(" > ====== Processing Track %6d ======== \n",itr);
const AliToyMCTrack *tr=fEvent->GetTrack(itr);
tOrig = *tr;
+ // ideal track propagated to ITS reference points
+ tOrigITS = *tr;
+ tOrigITS1 = *tr;
+ tOrigITS2 = *tr;
+ // propagate original track to ITS comparison points
+ AliTrackerBase::PropagateTrackTo(&tOrigITS, lastLayerITS,kMass,1,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
+ AliTrackerBase::PropagateTrackTo(&tOrigITS1,betweeTPCITS,kMass,1,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
+ AliTrackerBase::PropagateTrackTo(&tOrigITS2,iFCRadius, kMass,1,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
+
+ // realistic ITS track propagated to reference points
+ tRealITS = resetParam;
+ tRealITS1 = resetParam;
+ tRealITS2 = resetParam;
+ dummy = GetTrackRefit(tr,kITS);
+ if (dummy){
+ tRealITS = *dummy;
+ tRealITS1 = *dummy;
+ tRealITS2 = *dummy;
+ // propagate realistic track to ITS comparison points
+ AliTrackerBase::PropagateTrackTo(&tRealITS, lastLayerITS,kMass,1,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
+ AliTrackerBase::PropagateTrackTo(&tRealITS1,betweeTPCITS,kMass,1,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
+ AliTrackerBase::PropagateTrackTo(&tRealITS2,iFCRadius, kMass,1,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
+ //
+ delete dummy;
+ dummy=0x0;
+ }
+
- // set dummy
- t0seed = dummySeedT0;
- seed = dummySeed;
- track = dummyTrack;
+ // resetParam
+ t0seed = resetParam;
+ seed = resetParam;
+ track = resetParam;
+ trackITS = resetParam;
+ trackITS1 = resetParam;
+ trackITS2 = resetParam;
Float_t z0=fEvent->GetZ();
Float_t t0=fEvent->GetT0();
t0seed = *dummy;
delete dummy;
+ // Long seed
+ if (fLongT0seed){
+ dummy = GetFittedTrackFromSeed(tr,&t0seed);
+ t0seed = *dummy;
+ delete dummy;
+ }
+
// crate real seed using the time 0 from the first seed
// set fCreateT0seed now to false to get the seed in z coordinates
fTime0 = t0seed.GetZ()-zLength/vDrift;
// create fitted track
if (fDoTrackFit){
// printf("track\n");
- dummy = GetFittedTrackFromSeed(tr, &seed);
+ dummy = GetFittedTrackFromSeed(tr, &seed, arrClustRes);
track = *dummy;
delete dummy;
}
- // Copy original track and fitted track
- // for extrapolation to ITS last layer
- tOrigITS = *tr;
- trackITS = track;
-
+ // Copy original track and fitted track
+ // for extrapolation to ITS last layer
+ trackITS = track;
+ trackITS1 = track;
+ trackITS2 = track;
+
// propagate seed to 0
- const Double_t kMaxSnp = 0.85;
- const Double_t kMass = TDatabasePDG::Instance()->GetParticle("pi+")->Mass();
AliTrackerBase::PropagateTrackTo(&seed,0,kMass,5,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
- // propagate original track to ITS last layer
- Double_t lastLayerITS = 43.0; // same as in AliToyMCEventGenerator::MakeITSClusters (hard coded)
- AliTrackerBase::PropagateTrackTo(&tOrigITS,lastLayerITS,kMass,1,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
-
- // rotate fitted track to the frame of the original track and propagate to same reference
- AliTrackerBase::PropagateTrackTo(&trackITS,lastLayerITS,kMass,5,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
- trackITS.Rotate(tOrigITS.GetAlpha());
- AliTrackerBase::PropagateTrackTo(&trackITS,lastLayerITS,kMass,1,kFALSE,kMaxSnp,0,kFALSE,fUseMaterial);
-
-
+ //
+ // ITS comparison
+ //
+
+ // rotate fitted track to the frame of the original track and propagate to same reference
+ AliTrackerBase::PropagateTrackTo(&trackITS,lastLayerITS,kMass,5,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
+ trackITS.Rotate(tOrigITS.GetAlpha());
+ AliTrackerBase::PropagateTrackTo(&trackITS,lastLayerITS,kMass,1,kFALSE,kMaxSnp,0,kFALSE,fUseMaterial);
+
+ // rotate fitted track to the frame of the original track and propagate to same reference
+ AliTrackerBase::PropagateTrackTo(&trackITS1,betweeTPCITS,kMass,5,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
+ trackITS1.Rotate(tOrigITS1.GetAlpha());
+ AliTrackerBase::PropagateTrackTo(&trackITS1,betweeTPCITS,kMass,1,kFALSE,kMaxSnp,0,kFALSE,fUseMaterial);
+
+ // rotate fitted track to the frame of the original track and propagate to same reference
+ AliTrackerBase::PropagateTrackTo(&trackITS2,iFCRadius,kMass,5,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
+ trackITS2.Rotate(tOrigITS2.GetAlpha());
+ AliTrackerBase::PropagateTrackTo(&trackITS2,iFCRadius,kMass,1,kFALSE,kMaxSnp,0,kFALSE,fUseMaterial);
}
}
"zLength=" << zLength <<
"t0seed.=" << &t0seed <<
"seed.=" << &seed <<
- "track.=" << &track <<
+
"tOrig.=" << &tOrig <<
- "trackITS.=" << &trackITS <<
+ "track.=" << &track <<
+ // ITS match
"tOrigITS.=" << &tOrigITS <<
+ "tOrigITS1.=" << &tOrigITS1 <<
+ "tOrigITS2.=" << &tOrigITS2 <<
+
+ "tRealITS.=" << &tRealITS <<
+ "tRealITS1.=" << &tRealITS1 <<
+ "tRealITS2.=" << &tRealITS2 <<
+
+ "trackITS.=" << &trackITS <<
+ "trackITS1.=" << &trackITS1 <<
+ "trackITS2.=" << &trackITS2;
+
+ if (arrClustRes) {
+ const Int_t nCl=arrClustRes->GetEntriesFast();
+ // fracktion of outliers from track extrapolation
+ // for 1, 1.5, 2, 2.5 and 3 sigma of the cluster resolution (~1mm)
+ Float_t fracY[5]={0.};
+ Float_t fracZ[5]={0.};
+
+ for (Int_t icl=0; icl<nCl; ++icl) {
+ AliTPCclusterMI *cl=static_cast<AliTPCclusterMI*>(arrClustRes->At(icl));
+ const Float_t sigmaY=TMath::Sqrt(cl->GetSigmaY2());
+ const Float_t sigmaZ=TMath::Sqrt(cl->GetSigmaZ2());
+ for (Int_t inSig=0; inSig<5; ++inSig) {
+ fracY[inSig] += cl->GetY()>(1+inSig*.5)*sigmaY;
+ fracZ[inSig] += cl->GetZ()>(1+inSig*.5)*sigmaZ;
+ }
+ }
+
+ if (nCl>0) {
+ for (Int_t inSig=0; inSig<5; ++inSig) {
+ fracY[inSig]/=nCl;
+ fracZ[inSig]/=nCl;
+ }
+ }
+
+ (*fStreamer) << "Tracks" <<
+ "clustRes.=" << arrClustRes;
+ for (Int_t inSig=0; inSig<5; ++inSig) {
+ const char* fracYname=Form("clFracY%02d=", 10+inSig*5);
+ const char* fracZname=Form("clFracZ%02d=", 10+inSig*5);
+ (*fStreamer) << "Tracks" <<
+ fracYname << fracY[inSig] <<
+ fracZname << fracZ[inSig];
+ }
+ }
+
+ (*fStreamer) << "Tracks" <<
"\n";
}
}
}
+ delete arrClustRes;
Cleanup();
}
firstSeed=seeds.GetEntriesFast();
//shorter seeds
- upperRow-=5;
+ Int_t startUpper=upperRow-10;
+ Int_t startLower=lowerRow-5;
for (Int_t sec=0;sec<36;sec++){
+ upperRow=startUpper;
+ lowerRow=startLower;
printf(" in sector: %d\n",sec);
while (lowerRow>0){
printf("Run Seeding in %3d - %3d\n",lowerRow,upperRow);
// DumpTrackInfo(&seedsCentral2);
//dump clusters
- (*fStreamer) << "clusters" <<
- "cl.=" << &fAllClusters << "\n";
+// (*fStreamer) << "clusters" <<
+// "cl.=" << &fAllClusters << "\n";
Cleanup();
}
+//____________________________________________________________________________________
+AliExternalTrackParam* AliToyMCReconstruction::GetSeedFromTrackIdeal(const AliToyMCTrack * const tr, EDet det )
+{
+ //
+ // crate a seed from the track points of the respective detector
+ //
+ AliTrackPoint seedPoint[3];
+
+ Int_t npoints=0;
+ switch (det) {
+ case kITS:
+ npoints=tr->GetNumberOfITSPoints();
+ break;
+ case kTPC:
+ npoints=(fClusterType == 0)?tr->GetNumberOfSpacePoints():tr->GetNumberOfDistSpacePoints();
+ break;
+ case kTRD:
+ npoints=tr->GetNumberOfTRDPoints();
+ break;
+ }
+
+ if (npoints<3) return 0x0;
+
+ Int_t pos[3]={0,npoints/2,npoints-1};
+ const AliCluster *cl=0x0;
+
+ for (Int_t ipoint=0;ipoint<3;++ipoint){
+ Int_t cluster=pos[ipoint];
+ switch (det) {
+ case kITS:
+ seedPoint[ipoint]=(*tr->GetITSPoint(cluster));
+ break;
+ case kTPC:
+ cl=tr->GetSpacePoint(cluster);
+ if (fClusterType == 1) cl=tr->GetDistortedSpacePoint(cluster);
+ AliTPCclusterMI::SetGlobalTrackPoint(*cl,seedPoint[ipoint]);
+ break;
+ case kTRD:
+ seedPoint[ipoint]=(*tr->GetTRDPoint(cluster));
+ break;
+ }
+ }
+
+ AliExternalTrackParam *seed = AliTrackerBase::MakeSeed(seedPoint[0], seedPoint[1], seedPoint[2]);
+ seed->ResetCovariance(10);
+
+ return seed;
+}
+
//____________________________________________________________________________________
AliExternalTrackParam* AliToyMCReconstruction::GetSeedFromTrack(const AliToyMCTrack * const tr, Bool_t forceSeed)
{
AliError(Form("Seeding failed for parameters %d, %d\n",fSeedingDist,fSeedingRow));
return 0x0;
}
+
+ // determine preliminary theta
+ Float_t xyz1[3]={0,0,0};
+ Float_t xyz2[3]={0,0,0};
+ seedPoint[0].GetXYZ(xyz1);
+ seedPoint[2].GetXYZ(xyz2);
+ Float_t prelDeltaR = TMath::Sqrt(xyz2[0]*xyz2[0]+xyz2[1]*xyz2[1]) - TMath::Sqrt(xyz1[0]*xyz1[0]+xyz1[1]*xyz1[1]) ;
+ Float_t prelDeltaZ = ( seedCluster[0]->GetTimeBin() - seedCluster[2]->GetTimeBin() ) * GetVDrift();
+ Float_t prelTheta = TMath::ATan(prelDeltaR/prelDeltaZ);
+ if(prelTheta > TMath::Pi()/2) prelTheta = TMath::Pi() - prelTheta;
// do cluster correction for fCorrectionType:
// 0 - no correction
// 1 - TPC center
// 2 - average eta
// 3 - ideal
+ // 4 - preliminary eta (needs fixing!!! Not yet in full code!!!)
// assign the cluster abs time as z component to all seeds
for (Int_t iseed=0; iseed<3; ++iseed) {
Float_t xyz[3]={0,0,0};
const Int_t sector=seedCluster[iseed]->GetDetector();
const Int_t sign=1-2*((sector/18)%2);
+
+ Float_t zBeforeCorr = xyz[2];
if ( (fClusterType == 1) && (fCorrectionType != kNoCorrection) ) {
-// printf("correction type: %d\n",(Int_t)fCorrectionType);
-
// the settings below are for the T0 seed
// for known T0 the z position is already calculated in SetTrackPointFromCluster
if ( fCreateT0seed ){
if ( fCorrectionType == kTPCCenter ) xyz[2] = 125.*sign;
//!!! TODO: is this the correct association?
if ( fCorrectionType == kAverageEta ) xyz[2] = TMath::Tan(45./2.*TMath::DegToRad())*r*sign;
+ if ( fCorrectionType == kPreliminaryEta ) xyz[2] = r/TMath::Tan(prelTheta)*sign;//(needs fixing!!! Not yet in full code!!!)
}
if ( fCorrectionType == kIdeal ) xyz[2] = seedCluster[iseed]->GetZ();
-
+
+ // Store xyz only here!!! To get the Delta z from the correction...
+ zBeforeCorr = xyz[2];
+
//!!! TODO: to be replaced with the proper correction
fTPCCorrection->CorrectPoint(xyz, seedCluster[iseed]->GetDetector());
}
// after the correction set the time bin as z-Position in case of a T0 seed
if ( fCreateT0seed )
- xyz[2]=seedCluster[iseed]->GetTimeBin();
-
+ xyz[2]=seedCluster[iseed]->GetTimeBin() + sign*( zBeforeCorr - xyz[2] )/GetVDrift();
+
seedPoint[iseed].SetXYZ(xyz);
}
const Double_t kMass = TDatabasePDG::Instance()->GetParticle("pi+")->Mass();
AliExternalTrackParam *seed = AliTrackerBase::MakeSeed(seedPoint[0], seedPoint[1], seedPoint[2]);
- seed->ResetCovariance(10);
- if (fCreateT0seed){
+ if (fCreateT0seed&&!fLongT0seed){
+ // only propagate to vertex if we don't create a long seed
// if fTime0 < 0 we assume that we create a seed for the T0 estimate
AliTrackerBase::PropagateTrackTo(seed,0,kMass,5,kTRUE,kMaxSnp,0,kFALSE,kFALSE);
if (TMath::Abs(seed->GetX())>3) {
// printf("Could not propagate track to 0, %.2f, %.2f, %.2f\n",seed->GetX(),seed->GetAlpha(),seed->Pt());
}
}
-
+
+ seed->ResetCovariance(10);
return seed;
}
+//____________________________________________________________________________________
+AliExternalTrackParam* AliToyMCReconstruction::GetTrackRefit(const AliToyMCTrack * const tr, EDet det)
+{
+ //
+ // Get the ITS or TRD track refitted from the toy track
+ // type: 0=ITS; 1=TRD
+ //
+
+ AliExternalTrackParam *track=GetSeedFromTrackIdeal(tr,det);
+ if (!track) return 0x0;
+
+ const Double_t kMaxSnp = 0.85;
+ const Double_t kMass = TDatabasePDG::Instance()->GetParticle("pi+")->Mass();
+
+ Int_t npoints=0;
+ switch (det) {
+ case kITS:
+ npoints=tr->GetNumberOfITSPoints();
+ break;
+ case kTPC:
+ npoints=(fClusterType == 0)?tr->GetNumberOfSpacePoints():tr->GetNumberOfDistSpacePoints();
+ break;
+ case kTRD:
+ npoints=tr->GetNumberOfTRDPoints();
+ break;
+ }
+
+ const AliCluster *cl=0x0;
+
+ for (Int_t ipoint=0; ipoint<npoints; ++ipoint) {
+ AliTrackPoint pIn;
+
+ switch (det) {
+ case kITS:
+ pIn=(*tr->GetITSPoint(ipoint));
+ break;
+ case kTPC:
+ cl=tr->GetSpacePoint(ipoint);
+ if (fClusterType == 1) cl=tr->GetDistortedSpacePoint(ipoint);
+ AliTPCclusterMI::SetGlobalTrackPoint(*cl,pIn);
+ break;
+ case kTRD:
+ pIn=(*tr->GetTRDPoint(ipoint));
+ break;
+ }
+
+
+ const Double_t angle=pIn.GetAngle();
+ track->Rotate(angle);
+ AliTrackPoint prot = pIn.Rotate(track->GetAlpha()); // rotate to the local frame - non distoted point
+
+ if (!AliTrackerBase::PropagateTrackTo(track,prot.GetX(),kMass,5,kFALSE,kMaxSnp,0,kFALSE,fUseMaterial)) {
+ AliInfo(Form("Could not propagate track to x=%.2f (a=%.2f) for det %d",prot.GetX(),angle,det));
+ }
+ //
+
+ Double_t pointPos[2]={0,0};
+ Double_t pointCov[3]={0,0,0};
+ pointPos[0]=prot.GetY();//local y
+ pointPos[1]=prot.GetZ();//local z
+ pointCov[0]=prot.GetCov()[3];//simay^2
+ pointCov[1]=prot.GetCov()[4];//sigmayz
+ pointCov[2]=prot.GetCov()[5];//sigmaz^2
+
+ if (!track->Update(pointPos,pointCov)) {
+ AliInfo(Form("no update: det: %d",det));
+ break;
+ }
+
+ }
+
+ return track;
+}
+
//____________________________________________________________________________________
void AliToyMCReconstruction::SetTrackPointFromCluster(const AliTPCclusterMI *cl, AliTrackPoint &p )
// AliTrackPoint *tp=const_cast<AliTPCclusterMI*>(cl)->MakePoint(p);
// p=*tp;
// delete tp;
- const_cast<AliTPCclusterMI*>(cl)->MakePoint(p);
+// const_cast<AliTPCclusterMI*>(cl)->MakePoint(p);
+ AliTPCclusterMI::SetGlobalTrackPoint(*cl,p);
// cl->Print();
// p.Print();
p.SetVolumeID(cl->GetDetector());
}
//____________________________________________________________________________________
-AliExternalTrackParam* AliToyMCReconstruction::GetFittedTrackFromSeed(const AliToyMCTrack *tr, const AliExternalTrackParam *seed)
+AliExternalTrackParam* AliToyMCReconstruction::GetFittedTrackFromSeed(const AliToyMCTrack *tr, const AliExternalTrackParam *seed, TClonesArray *arrClustRes)
{
//
//
//
+ if (arrClustRes) {
+ arrClustRes->Clear();
+ }
+
// create track
AliExternalTrackParam *track = new AliExternalTrackParam(*seed);
AliTrackPoint pIn;
const AliTPCclusterMI *cl=tr->GetSpacePoint(ipoint);
if (fClusterType == 1) cl=tr->GetDistortedSpacePoint(ipoint);
+ const Int_t globalRow = cl->GetRow() +(cl->GetDetector() >35)*63;
+ if ( fCreateT0seed ){
+ if ( globalRow<fSeedingRow || globalRow>fSeedingRow+2*fSeedingDist ) continue;
+ }
+
SetTrackPointFromCluster(cl, pIn);
+
+ Float_t xyz[3]={0,0,0};
+ pIn.GetXYZ(xyz);
+ Float_t zBeforeCorr = xyz[2];
+
+ const Int_t sector=cl->GetDetector();
+ const Int_t sign=1-2*((sector/18)%2);
+
if (fCorrectionType != kNoCorrection){
- Float_t xyz[3]={0,0,0};
- pIn.GetXYZ(xyz);
-// if ( fCorrectionType == kIdeal ) xyz[2] = cl->GetZ();
+
+ const Float_t r=TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
+
+ if ( fCreateT0seed ){
+ if ( fCorrectionType == kTPCCenter ) xyz[2] = 125.*sign;
+ //!!! TODO: is this the correct association?
+ if ( fCorrectionType == kAverageEta ) xyz[2] = TMath::Tan(45./2.*TMath::DegToRad())*r*sign;
+ if ( fCorrectionType == kIdeal ) xyz[2] = cl->GetZ();
+ }
+
+ // Store xyz only here!!! To get the Delta z from the correction...
+ zBeforeCorr = xyz[2];
+
fTPCCorrection->CorrectPoint(xyz, cl->GetDetector());
- pIn.SetXYZ(xyz);
}
+
+ if ( fCreateT0seed )
+ xyz[2]=cl->GetTimeBin() + sign*( zBeforeCorr - xyz[2] )/GetVDrift();
+ // xyz[2]=cl->GetTimeBin();
+ pIn.SetXYZ(xyz);
+
// rotate the cluster to the local detector frame
track->Rotate(((cl->GetDetector()%18)*20+10)*TMath::DegToRad());
AliTrackPoint prot = pIn.Rotate(track->GetAlpha()); // rotate to the local frame - non distoted point
if (TMath::Abs(track->GetX())>kMaxR) break;
// if (TMath::Abs(track->GetZ())<kZcut)continue;
//
+
+ // add residuals
+ if (arrClustRes) {
+ TClonesArray &arrDummy=*arrClustRes;
+ AliTPCclusterMI *clRes = new(arrDummy[arrDummy.GetEntriesFast()]) AliTPCclusterMI(*cl);
+ clRes->SetX(prot.GetX());
+ clRes->SetY(track->GetY()-prot.GetY());
+ clRes->SetZ(track->GetZ()-prot.GetZ());
+ }
+
Double_t pointPos[2]={0,0};
Double_t pointCov[3]={0,0,0};
pointPos[0]=prot.GetY();//local y
AliTrackerBase::PropagateTrackTo2(track,refX,kMass,5.,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
- // rotate fittet track to the frame of the original track and propagate to same reference
- track->Rotate(tr->GetAlpha());
+ if (!fCreateT0seed){
+ // rotate fittet track to the frame of the original track and propagate to same reference
+ track->Rotate(tr->GetAlpha());
- AliTrackerBase::PropagateTrackTo2(track,refX,kMass,1.,kFALSE,kMaxSnp,0,kFALSE,fUseMaterial);
+ AliTrackerBase::PropagateTrackTo2(track,refX,kMass,1.,kFALSE,kMaxSnp,0,kFALSE,fUseMaterial);
+ }
return track;
}
-
//____________________________________________________________________________________
AliExternalTrackParam* AliToyMCReconstruction::GetFittedTrackFromSeedAllClusters(const AliToyMCTrack *tr, const AliExternalTrackParam *seed, Int_t &nClus)
{
rieman2.AddPoint(n->GetX(), n->GetY(), n->GetZ(),
TMath::Sqrt(n->GetSigmaY2()), TMath::Sqrt(n->GetSigmaZ2()));
rieman2.Update();
- printf(" Riemann results: row=%d valid=%d, Chi2=%.2f (%.2f) %d (%d)",
- iRow, rieman2.IsValid(), rieman2.GetChi2(), rieman1.GetChi2(), n->GetLabel(0),seed.GetLabel());
+// printf(" Riemann results: row=%d valid=%d, Chi2=%.2f (%.2f) %d (%d)",
+// iRow, rieman2.IsValid(), rieman2.GetChi2(), rieman1.GetChi2(), n->GetLabel(0),seed.GetLabel());
Double_t limit=2*rieman1.GetChi2();
if (fClusterType==0) limit=1000;
if (rieman2.GetChi2()>limit) {
CopyRieman(rieman1,rieman2);
++noLastPoint;
- printf("\n");
+// printf("\n");
continue;
}
- printf(" +++ \n");
+// printf(" +++ \n");
noLastPoint=0;
//use point
//
//
- printf("\n ============ \nnext Seed: %d\n",seed.GetLabel());
+// printf("\n ============ \nnext Seed: %d\n",seed.GetLabel());
//assume seed is within one sector
Int_t iMiddle=(seed.GetSeed1()+seed.GetSeed2())/2;
//outward
}
}
- tFirst->GetListOfFriends()->Print();
+ if (tFirst->GetListOfFriends()) tFirst->GetListOfFriends()->Print();
return tFirst;
}
// a 'valid' position in z is needed for the seeding procedure
Double_t sign=1;
if (((sec/18)%2)==1) sign=-1;
- cl->SetZ(cl->GetTimeBin()*GetVDrift()*sign);
+ cl->SetZ(cl->GetTimeBin()*GetVDrift());
//mark cluster to be time*vDrift by setting the type to 1
cl->SetType(1);
// cl->SetZ(cl->GetTimeBin());
TMath::Sqrt(clMiddle->GetSigmaY2()), TMath::Sqrt(clMiddle->GetSigmaZ2()));
if (seedFit.GetN()>3) {
- printf(" call update: %d (%d)\n",seedFit.GetN(),nTotalClusters);
- printf(" Riemann results: valid=%d, Chi2=%.2f, Chi2Y=%.2f, Chi2Z=%.2f -- %d\n",
- seedFit.IsValid(), seedFit.GetChi2(), seedFit.GetChi2Y(), seedFit.GetChi2Z(), clMiddle->GetLabel(0));
+// printf(" call update: %d (%d)\n",seedFit.GetN(),nTotalClusters);
+// printf(" Riemann results: valid=%d, Chi2=%.2f, Chi2Y=%.2f, Chi2Z=%.2f -- %d\n",
+// seedFit.IsValid(), seedFit.GetChi2(), seedFit.GetChi2Y(), seedFit.GetChi2Z(), clMiddle->GetLabel(0));
seedFit.Update();
}
if ( seedFit.IsValid() && seedFit.GetChi2()>1000 ) return;
for (Int_t iInner=0; iInner < krInner; iInner++) {
const AliTPCclusterMI *clInner = krInner[iInner];
if (clInner->IsUsed()) continue;
-printf("\n\n Check combination %d (%d), %d (%d) -- %d (%d) -- %d\n",iOuter, iInner, clOuter->GetLabel(0), clInner->GetLabel(0),iRowOuter,iRowInner,sec);
+// printf("\n\n Check combination %d (%d), %d (%d) -- %d (%d) -- %d\n",iOuter, iInner, clOuter->GetLabel(0), clInner->GetLabel(0),iRowOuter,iRowInner,sec);
// check maximum distance for combinatorics
if (TMath::Abs(clOuter->GetZ()-clInner->GetZ())>timeRoadCombinatorics) continue;
-printf(" Is inside one drift\n");
+// printf(" Is inside one drift\n");
// use rieman fit for seed description
AliRieman seedFit(159);
// Iteratively add all clusters in the respective middle
Int_t nFoundClusters=2;
AddMiddleClusters(seed,clInner,clOuter,padRoad,timeRoad,nFoundClusters,seedFit);
- printf(" Clusters attached: %d\n",nFoundClusters);
+// printf(" Clusters attached: %d\n",nFoundClusters);
if (nFoundClusters>2) seedFit.Update();
- printf(" Riemann results: valid=%d, Chi2=%.2f, Chi2Y=%.2f, Chi2Z=%.2f\n",
- seedFit.IsValid(), seedFit.GetChi2(), seedFit.GetChi2Y(), seedFit.GetChi2Z());
+// printf(" Riemann results: valid=%d, Chi2=%.2f, Chi2Y=%.2f, Chi2Z=%.2f\n",
+// seedFit.IsValid(), seedFit.GetChi2(), seedFit.GetChi2Y(), seedFit.GetChi2Z());
// check for minimum number of assigned clusters and a decent chi2
if ( nFoundClusters<0.5*nMaxClusters || seedFit.GetChi2()>1000 ){
if (!fTree) return;
- TString debugName=fInputFile->GetName();
+ TString debugName=gSystem->BaseName(fInputFile->GetName());
debugName.ReplaceAll(".root","");
debugName.Append(Form(".%1d.%1d_%1d_%1d_%03d_%02d",
fUseMaterial,fIdealTracking,fClusterType,
if (!fInputFile || !fInputFile->IsOpen() || fInputFile->IsZombie()) {
delete fInputFile;
fInputFile=0x0;
- printf("ERROR: couldn't open the file '%s'\n", file);
+ AliError(Form("ERROR: couldn't open the file '%s'\n", file));
return;
}
fTree=(TTree*)fInputFile->Get("toyMCtree");
if (!fTree) {
- printf("ERROR: couldn't read the 'toyMCtree' from file '%s'\n", file);
+ AliError(Form("ERROR: couldn't read the 'toyMCtree' from file '%s'\n", file));
return;
}
AliExternalTrackParam tOrigITS(*toyTrack);
// propagate original track to ITS last layer
- Double_t lastLayerITS = 43.0; // same as in AliToyMCEventGenerator::MakeITSClusters (hard coded)
+// Double_t lastLayerITS = 43.0; // same as in AliToyMCEventGenerator::MakeITSClusters (hard coded)
+ const Double_t iFCRadius = 83.5; //radius constants found in AliTPCCorrection.cxx
+ Double_t lastLayerITS = iFCRadius; // its track propgated to inner TPC wall
AliTrackerBase::PropagateTrackTo(&tOrigITS,lastLayerITS,kMass,1,kTRUE,kMaxSnp,0,kFALSE,fUseMaterial);
AliExternalTrackParam dummyParam;