Float_t label = v(0);
Int_t centralPad = (fTPCParam->GetNPads(fCurrentIndex[1],fCurrentIndex[3]-1)-1)/2;
- Int_t nElectrons = (tv->GetNrows()-1)/4;
+ Int_t nElectrons = (tv->GetNrows()-1)/5;
indexRange[0]=9999; // min pad
indexRange[1]=-1; // max pad
indexRange[2]=9999; //min time
// Loop over all electrons
//
for(Int_t nel=0; nel<nElectrons; nel++){
- Int_t idx=nel*4;
+ Int_t idx=nel*5;
Float_t aval = v(idx+4);
Float_t eltoadcfac=aval*fTPCParam->GetTotalNormFac();
- Float_t xyz[3]={v(idx+1),v(idx+2),v(idx+3)};
+ Float_t xyz[4]={v(idx+1),v(idx+2),v(idx+3),v(idx+5)};
Int_t n = ((AliTPCParamSR*)fTPCParam)->CalcResponseFast(xyz,fCurrentIndex,fCurrentIndex[3]);
Int_t *index = fTPCParam->GetResBin(0);
Float_t gasgain = fTPCParam->GetGasGain();
Int_t i;
- Float_t xyz[4];
+ Float_t xyz[5];
AliTPChit *tpcHit; // pointer to a sigle TPC hit
//MI change
if(nofElectrons[i]>0){
TVector &v = *tracks[i];
v(0) = previousTrack;
- tracks[i]->ResizeTo(4*nofElectrons[i]+1); // shrink if necessary
+ tracks[i]->ResizeTo(5*nofElectrons[i]+1); // shrink if necessary
row[i]->Add(tracks[i]);
}
else {
}
nofElectrons[i]=0;
- tracks[i] = new TVector(481); // TVectors for the next fTrack
+ tracks[i] = new TVector(601); // TVectors for the next fTrack
} // end of loop over rows
TransportElectron(xyz,index);
Int_t rowNumber;
fTPCParam->GetPadRow(xyz,index);
+ // Electron track time (for pileup simulation)
+ xyz[4] = tpcHit->Time()/fTPCParam->GetTSample();
// row 0 - cross talk from the innermost row
// row fNRow+1 cross talk from the outermost row
rowNumber = index[2]+1;
//----------------------------------
if(nofElectrons[rowNumber]>120){
Int_t range = tracks[rowNumber]->GetNrows();
- if((nofElectrons[rowNumber])>(range-1)/4){
+ if((nofElectrons[rowNumber])>(range-1)/5){
- tracks[rowNumber]->ResizeTo(range+400); // Add 100 electrons
+ tracks[rowNumber]->ResizeTo(range+500); // Add 100 electrons
}
}
TVector &v = *tracks[rowNumber];
- Int_t idx = 4*nofElectrons[rowNumber]-3;
+ Int_t idx = 5*nofElectrons[rowNumber]-4;
Real_t * position = &(((TVector&)v)(idx)); //make code faster
- memcpy(position,xyz,4*sizeof(Float_t));
+ memcpy(position,xyz,5*sizeof(Float_t));
} // end of loop over electrons
if(nofElectrons[i]>0){
TVector &v = *tracks[i];
v(0) = previousTrack;
- tracks[i]->ResizeTo(4*nofElectrons[i]+1); // shrink if necessary
+ tracks[i]->ResizeTo(5*nofElectrons[i]+1); // shrink if necessary
row[i]->Add(tracks[i]);
}
else{
fY = hits[1];
fZ = hits[2];
fQ = hits[3];
+ fTime = hits[4];
}
//________________________________________________________________________
}
if (fTrackHits && fHitType&4)
fTrackHits->AddHitKartez(vol[0],rtrack, hits[0],
- hits[1],hits[2],(Int_t)hits[3]);
+ hits[1],hits[2],(Int_t)hits[3],hits[4]);
// if (fTrackHitsOld &&fHitType&2 )
// fTrackHitsOld->AddHitKartez(vol[0],rtrack, hits[0],
// hits[1],hits[2],(Int_t)hits[3]);
Int_t fSector; //sector number
Int_t fPadRow; //Pad Row number
Float_t fQ ; //charge
+ Float_t fTime; //hit time
public:
- AliTPChit() {}
+ AliTPChit() {fTime = 0.;}
AliTPChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
virtual ~AliTPChit() {}
void SetX(Float_t x){fX = x;}
void SetY(Float_t y){fY = y;}
void SetZ(Float_t z){fZ = z;}
+
+ Float_t Time() const {return fTime;}
- ClassDef(AliTPChit,1) // Time Projection Chamber hits
+ ClassDef(AliTPChit,2) // Time Projection Chamber hits
};
//we suppose that coordinate is expressed in float digits
// it's mean coordinate system 8
//xyz[0] - float padrow xyz[1] is float pad (center pad is number 0) and xyz[2] is float time bin
+ //xyz[3] - electron time in float time bin format
if ( (fInnerPRF==0)||(fOuter1PRF==0)||(fOuter2PRF==0) ||(fTimeRF==0) ){
Error("AliTPCParamSR", "response function was not adjusted");
return -1;
Int_t fpadrow = TMath::Max(TMath::Nint(index[2]+xyz[0]-sfpadrow),0); //"first" padrow
Int_t fpad = TMath::Nint(xyz[1]-sfpad); //first pad
- Int_t ftime = TMath::Max(TMath::Nint(xyz[2]+GetZOffset()/GetZWidth()-sftime),0); // first time
+ Int_t ftime = TMath::Max(TMath::Nint(xyz[2]+xyz[3]+GetZOffset()/GetZWidth()-sftime),0); // first time
Int_t lpadrow = TMath::Min(TMath::Nint(index[2]+xyz[0]+sfpadrow),fpadrow+19); //"last" padrow
lpadrow = TMath::Min(GetNRow(index[1])-1,lpadrow);
Int_t lpad = TMath::Min(TMath::Nint(xyz[1]+sfpad),fpad+19); //last pad
- Int_t ltime = TMath::Min(TMath::Nint(xyz[2]+GetZOffset()/GetZWidth()+sftime),ftime+19); // last time
+ Int_t ltime = TMath::Min(TMath::Nint(xyz[2]+xyz[3]+GetZOffset()/GetZWidth()+sftime),ftime+19); // last time
ltime = TMath::Min(ltime,GetMaxTBin()-1);
//
Int_t npads = GetNPads(index[1],row);
//calculate time response function
Int_t time;
for (time = ftime;time<=ltime;time++)
- timeres[time-ftime]= fTimeRF->GetRF((-xyz[2]+Float_t(time))*fZWidth);
+ timeres[time-ftime]= fTimeRF->GetRF((-xyz[2]-xyz[3]+Float_t(time))*fZWidth);
//write over threshold values to stack
for (padrow = fpadrow;padrow<=lpadrow;padrow++)
for (pad = fpad;pad<=lpad;pad++)
// it's mean coordinate system 8
//xyz[0] - electron position w.r.t. pad center, normalized to pad length,
//xyz[1] is float pad (center pad is number 0) and xyz[2] is float time bin
+ //xyz[3] - electron time in float time bin format
if ( (fInnerPRF==0)||(fOuter1PRF==0)||(fOuter2PRF==0) ||(fTimeRF==0) ){
Error("AliTPCParamSR", "response function was not adjusted");
return -1;
Int_t npads = GetNPads(index[1],index[3]-1);
Int_t cpadrow = index[2]; // electrons are here
Int_t cpad = TMath::Nint(xyz[1]);
- Int_t ctime = TMath::Nint(xyz[2]+zoffset2);
+ Int_t ctime = TMath::Nint(xyz[2]+zoffset2+xyz[3]);
//calulate deviation
Float_t dpadrow = xyz[0];
Float_t dpad = xyz[1]-cpad;
- Float_t dtime = xyz[2]+zoffset2-ctime;
+ Float_t dtime = xyz[2]+zoffset2+xyz[3]-ctime;
Int_t cindex =0;
Int_t cindex3 =0;
Int_t maxt =GetMaxTBin();
ClassImp(AliTPCReconstructor)
-Double_t AliTPCReconstructor::fgCtgRange = 1.05;
+Double_t AliTPCReconstructor::fgCtgRange = 4.05;
//_____________________________________________________________________________
void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader) const
Int_t AliTPCTrackHits::fgCounter2 =0;
const Double_t AliTPCTrackHits::fgkPrecision=1e-6; //precision
const Double_t AliTPCTrackHits::fgkPrecision2=1e-20; //precision
+const Double_t AliTPCTrackHits::fgkTimePrecision=20.e-9; //hit time precision
class AliTPCCurrentHit {
AliTPCTempHitInfo & operator = (const AliTPCTempHitInfo &)
{::Fatal("= operator","Not implemented\n");return *this;}
- void NewParam(Double_t r, Double_t z, Double_t fi, Int_t q);
- void SetHit(Double_t r, Double_t z, Double_t fi, Int_t q);
+ void NewParam(Double_t r, Double_t z, Double_t fi, Int_t q, Float_t time);
+ void SetHit(Double_t r, Double_t z, Double_t fi, Int_t q, Float_t time);
Double_t * GetPosition(Int_t index){return &fPositionStack[index*3];}
void UpdateParam(Double_t maxdelta); //recal
void Fit2(Double_t fSumY, Double_t fSumYX, Double_t fSumYX2,
Double_t fOldR; //previos r
Double_t fPositionStack[3*kStackSize]; //position stack
UInt_t fQStack[kStackSize]; //Q stack
+ Float_t fTimeStack[kStackSize]; //time stack
UInt_t fStackIndex; //current stack index
UInt_t fInfoIndex; //current track info index
UInt_t fParamIndex; //current track parameters index
}
-void AliTPCTempHitInfo::NewParam(Double_t r, Double_t z, Double_t fi, Int_t q)
+void AliTPCTempHitInfo::NewParam(Double_t r, Double_t z, Double_t fi, Int_t q, Float_t time)
{
//
//reset stack and sum parameters
fParam->fAd = 0.;
fParam->fTheta =0.;
fParam->fThetaD =0.;
- SetHit(r,z,fi,q);
+ SetHit(r,z,fi,q,time);
}
-void AliTPCTempHitInfo::SetHit(Double_t r, Double_t z, Double_t fi, Int_t q)
+void AliTPCTempHitInfo::SetHit(Double_t r, Double_t z, Double_t fi, Int_t q, Float_t time)
{
//
//add hit to the stack
f[1] = z;
f[2] = fi;
fQStack[fStackIndex]=q;
+ fTimeStack[fStackIndex]=time;
if (fStackIndex==0) return;
Double_t dr = (r-fParam->fR);
if (TMath::Abs(dr)<AliTPCTrackHits::fgkPrecision) dr =AliTPCTrackHits::fgkPrecision;
void AliTPCTrackHits::AddHitKartez(Int_t volumeID, Int_t trackID, Double_t x,
- Double_t y, Double_t z,Int_t q)
+ Double_t y, Double_t z,Int_t q, Float_t time)
{
//add hits (cartesian)
Double_t r = TMath::Sqrt(x*x+y*y);
Double_t fi = TMath::ACos(x/r);
if (y<0) fi*=-1.;
- AddHit(volumeID,trackID,r,z,fi,q);
+ AddHit(volumeID,trackID,r,z,fi,q,time);
}
void AliTPCTrackHits::AddHit(Int_t volumeID, Int_t trackID,
- Double_t r, Double_t z, Double_t fi, Int_t q)
+ Double_t r, Double_t z, Double_t fi, Int_t q, Float_t time)
{
//
Bool_t diff=kFALSE;
fTempInfo->fParam =
(AliTrackHitsParam*) (fTrackHitsParam->At(0));
fTempInfo->fParamIndex = 0;
- fTempInfo->NewParam(r,z,fi,q);
+ fTempInfo->NewParam(r,z,fi,q,time);
return;
}
fTrackHitsParam->Resize(fTempInfo->fParamIndex+1);
fTempInfo->fParam =
(AliTrackHitsParam*) (fTrackHitsParam->At(fTempInfo->fParamIndex));
- fTempInfo->NewParam(r,z,fi,q);
+ fTempInfo->NewParam(r,z,fi,q,time);
return;
}
fTrackHitsParam->Resize(fTempInfo->fParamIndex+1);
fTempInfo->fParam =
(AliTrackHitsParam*) (fTrackHitsParam->At(fTempInfo->fParamIndex));
- fTempInfo->NewParam(r,z,fi,q);
+ fTempInfo->NewParam(r,z,fi,q,time);
return;
}
diff=kTRUE;
else{
fTempInfo->fStackIndex++;
- fTempInfo->SetHit(r,z,fi,q);
+ fTempInfo->SetHit(r,z,fi,q,time);
return;
}
//if parameter changed
fTrackHitsParam->Resize(fTempInfo->fParamIndex+1);
fTempInfo->fParam =
(AliTrackHitsParam*) (fTrackHitsParam->At(fTempInfo->fParamIndex));
- fTempInfo->NewParam(r,z,fi,q);
+ fTempInfo->NewParam(r,z,fi,q,time);
}
else{
fTempInfo->fStackIndex++;
- fTempInfo->SetHit(r,z,fi,q);
+ fTempInfo->SetHit(r,z,fi,q,time);
}
}
info = (AliHitInfo*)(fHitsPosAndQ->At(fTempInfo->fParamIndex,i));
info->fHitDistance = (TMath::Abs(dl/fStep)<32000) ?Short_t(TMath::Nint(dl/fStep)):0;
info->fCharge = Short_t(fTempInfo->fQStack[i]);
+ info->fTime = TMath::Nint(fTempInfo->fTimeStack[i]/AliTPCTrackHits::fgkTimePrecision);
/*
cout<<"C2";
cout<<" "<<fTempInfo->fStackIndex<<" \t";
(AliTrackHitsParam*) (fTrackHitsParam->At(fTempInfo->fParamIndex));
Double_t * p = fTempInfo->GetPosition(i);
UInt_t index2 = fTempInfo->fStackIndex;
- fTempInfo->NewParam(p[0],p[1],p[2],fTempInfo->fQStack[i]);
+ fTempInfo->NewParam(p[0],p[1],p[2],fTempInfo->fQStack[i],fTempInfo->fTimeStack[i]);
if (i+1<=index2) FlushHitStack2(i+1,index2);
if (force) return FlushHitStack(kTRUE);
// call only for hits where first iteration were not succesfully interpolated
Double_t * positionstack = new Double_t[3*(index2-index1+1)];
UInt_t * qstack = new UInt_t[index2-index1+1];
+ Float_t * timestack = new Float_t[index2-index1+1];
memcpy(positionstack, &fTempInfo->fPositionStack[3*index1],
(3*(index2-index1+1))*sizeof(Double_t));
memcpy(qstack, &fTempInfo->fQStack[index1],(index2-index1+1)*sizeof(UInt_t));
+ memcpy(timestack, &fTempInfo->fTimeStack[index1],(index2-index1+1)*sizeof(Float_t));
Double_t *p = positionstack;
for (Int_t j=0; j<=index2-index1;j++){
fTempInfo->fStackIndex++;
- fTempInfo->SetHit(p[3*j+0],p[3*j+1],p[3*j+2],qstack[j]);
+ fTempInfo->SetHit(p[3*j+0],p[3*j+1],p[3*j+2],qstack[j],timestack[j]);
}
delete []positionstack;
delete []qstack;
+ delete []timestack;
}
fCurrentHit->fHit.SetX(param->fR*TMath::Cos(param->fFi));
fCurrentHit->fHit.SetY(param->fR*TMath::Sin(param->fFi));
fCurrentHit->fHit.SetZ(param->fZ);
- fCurrentHit->fHit.fQ = hinfo->fCharge;
+ fCurrentHit->fHit.fQ = (Float_t)(hinfo->fCharge*AliTPCTrackHits::fgkTimePrecision);
+ fCurrentHit->fHit.fTime = hinfo->fTime;
fCurrentHit->fR = param->fR;
}
fCurrentHit->fHit.fQ = hinfo->fCharge;
+ fCurrentHit->fHit.fTime = (Float_t)(hinfo->fTime*AliTPCTrackHits::fgkTimePrecision);
fCurrentHit->fR += fStep*hinfo->fHitDistance/ratio;
Double_t dR = fCurrentHit->fR - param->fR;
//Double_t dR =0;
}
fCurrentHit->fHit.fQ = hinfo->fCharge;
+ fCurrentHit->fHit.fTime = (Float_t)(hinfo->fTime*AliTPCTrackHits::fgkTimePrecision);
fCurrentHit->fR += fStep*hinfo->fHitDistance/ratio;
Double_t dR = fCurrentHit->fR - param->fR;
//Double_t dR =0;
private:
Short_t fHitDistance; //distance to previous hit
Short_t fCharge; //deponed charge
+ Short_t fTime; //hit time
static Int_t fgCounter1; //counter
static Int_t fgCounter2; //counter
- LClassDef(AliHitInfo,1)
+ LClassDef(AliHitInfo,2)
};
void Clear();
void AddHitKartez(Int_t volumeID, Int_t trackID, Double_t x,
- Double_t y, Double_t z,Int_t q);
+ Double_t y, Double_t z,Int_t q, Float_t time);
void AddHit(Int_t volumeID, Int_t trackID, Double_t r,
- Double_t z, Double_t fi,Int_t q);
+ Double_t z, Double_t fi,Int_t q,Float_t time);
Bool_t First(); //set current hit to first hit
Bool_t Next(Int_t id = -1); //set current hit to next
AliTPCCurrentHit * fCurrentHit; //!information about current hit
static const Double_t fgkPrecision; //precision
static const Double_t fgkPrecision2; //precision
+ static const Double_t fgkTimePrecision; //hit time precision
static Int_t fgCounter1; // counter1
static Int_t fgCounter2; // counter2
- ClassDef(AliTPCTrackHits,1)
+ ClassDef(AliTPCTrackHits,2)
};
//
const Double_t AliTPCTrackHitsV2::fgkPrecision=1e-6; //precision
const Double_t AliTPCTrackHitsV2::fgkPrecision2=1e-20; //precision
+const Double_t AliTPCTrackHitsV2::fgkTimePrecision=20.e-9; //hit time precision
{hit.Copy(*this);}
AliTPCTempHitInfoV2& operator = (const AliTPCTempHitInfoV2 &hit)
{hit.Copy(*this); return (*this);}
- void NewParam(Double_t r, Double_t z, Double_t fi, Int_t q);
- void SetHit(Double_t r, Double_t z, Double_t fi, Int_t q);
+ void NewParam(Double_t r, Double_t z, Double_t fi, Int_t q, Float_t time);
+ void SetHit(Double_t r, Double_t z, Double_t fi, Int_t q, Float_t time);
Double_t * GetPosition(Int_t index){return &fPositionStack[index*3];}
void UpdateParam(Double_t maxdelta); //recal
void Fit2(Double_t fSumY, Double_t fSumYX, Double_t fSumYX2,
Double_t fOldR; //previos r
Double_t fPositionStack[3*kStackSize]; //position stack
UInt_t fQStack[kStackSize]; //Q stack
+ Float_t fTimeStack[kStackSize]; //time stack
UInt_t fStackIndex; //current stack index
// UInt_t fInfoIndex; //current track info index
UInt_t fParamIndex; //current track parameters index
}
-void AliTPCTempHitInfoV2::NewParam(Double_t r, Double_t z, Double_t fi, Int_t q)
+void AliTPCTempHitInfoV2::NewParam(Double_t r, Double_t z, Double_t fi, Int_t q, Float_t time)
{
//
//reset stack and sum parameters
fParam->fAd = 0.;
fParam->fTheta =0.;
fParam->fThetaD =0.;
- SetHit(r,z,fi,q);
+ SetHit(r,z,fi,q,time);
}
-void AliTPCTempHitInfoV2::SetHit(Double_t r, Double_t z, Double_t fi, Int_t q)
+void AliTPCTempHitInfoV2::SetHit(Double_t r, Double_t z, Double_t fi, Int_t q, Float_t time)
{
//
//add hit to the stack
f[1] = z;
f[2] = fi;
fQStack[fStackIndex]=q;
+ fTimeStack[fStackIndex]=time;
if (fStackIndex==0) return;
Double_t dr = (r-fParam->fR);
if (TMath::Abs(dr)<AliTPCTrackHitsV2::fgkPrecision) dr =AliTPCTrackHitsV2::fgkPrecision;
fgCounter2++;
fHitDistance=0;
fCharge=0;
+ fTime=0;
fNHits=0;
}
delete[]fCharge;
fCharge =0;
}
+ if (fTime){
+ delete[]fTime;
+ fTime =0;
+ }
}
void AliTPCTrackHitsV2::AddHitKartez(Int_t volumeID, Int_t trackID, Double_t x,
- Double_t y, Double_t z,Int_t q)
+ Double_t y, Double_t z,Int_t q, Float_t time)
{
//
// add hit to the container - it add hit at the end - input in global coordinata
Double_t r = TMath::Sqrt(x*x+y*y);
Double_t fi = TMath::ACos(x/r);
if (y<0) fi*=-1.;
- AddHit(volumeID,trackID,r,z,fi,q);
+ AddHit(volumeID,trackID,r,z,fi,q,time);
}
void AliTPCTrackHitsV2::AddHit(Int_t volumeID, Int_t trackID,
- Double_t r, Double_t z, Double_t fi, Int_t q)
+ Double_t r, Double_t z, Double_t fi, Int_t q, Float_t time)
{
//
// Adding one hit
AddVolume(volumeID);
//
fTempInfo->fParamIndex = 0;
- fTempInfo->NewParam(r,z,fi,q);
+ fTempInfo->NewParam(r,z,fi,q,time);
return;
}
fTempInfo->fParam = new((*fArray)[fTempInfo->fParamIndex]) AliTrackHitsParamV2;
fTempInfo->fParam->fVolumeID = volumeID;
fTempInfo->fParam->fTrackID = trackID;
- fTempInfo->NewParam(r,z,fi,q);
+ fTempInfo->NewParam(r,z,fi,q,time);
return;
}
diff=kTRUE;
else{ // if precision OK
fTempInfo->fStackIndex++;
- fTempInfo->SetHit(r,z,fi,q);
+ fTempInfo->SetHit(r,z,fi,q,time);
return;
}
fTempInfo->fParam = new((*fArray)[fTempInfo->fParamIndex]) AliTrackHitsParamV2;
fTempInfo->fParam->fVolumeID = volumeID;
fTempInfo->fParam->fTrackID = trackID;
- fTempInfo->NewParam(r,z,fi,q);
+ fTempInfo->NewParam(r,z,fi,q,time);
}
else{
fTempInfo->fStackIndex++;
- fTempInfo->SetHit(r,z,fi,q);
+ fTempInfo->SetHit(r,z,fi,q,time);
}
}
param.fNHits = fTempInfo->fStackIndex+1;
if (param.fHitDistance) delete []param.fHitDistance;
if (param.fCharge) delete []param.fCharge;
+ if (param.fTime) delete []param.fTime;
param.fHitDistance = new Short_t[param.fNHits];
param.fCharge = new Short_t[param.fNHits];
+ param.fTime = new Short_t[param.fNHits];
for (i=0; i <= fTempInfo->fStackIndex; i++){
param.fHitDistance[i]= Short_t(TMath::Nint(dl/fStep));
param.fCharge[i]= Short_t(fTempInfo->fQStack[i]);
+ param.fTime[i]= Short_t(fTempInfo->fTimeStack[i]/AliTPCTrackHitsV2::fgkTimePrecision);
}
if (i<=fTempInfo->fStackIndex){ //if previous iteration not succesfull
Short_t * charge = new Short_t[i];
+ Short_t * time = new Short_t[i];
Short_t * hitDistance= new Short_t[i];
memcpy(charge, param.fCharge,sizeof(Short_t)*i);
+ memcpy(time, param.fTime,sizeof(Short_t)*i);
memcpy(hitDistance, param.fHitDistance,sizeof(Short_t)*i);
delete [] param.fCharge;
+ delete [] param.fTime;
delete [] param.fHitDistance;
param.fNHits= i;
param.fCharge = charge;
+ param.fTime = time;
param.fHitDistance = hitDistance;
//
Int_t volumeID = fTempInfo->fParam->fVolumeID;
fTempInfo->fParam = new((*fArray)[fTempInfo->fParamIndex]) AliTrackHitsParamV2;
Double_t * p = fTempInfo->GetPosition(i);
UInt_t index2 = fTempInfo->fStackIndex;
- fTempInfo->NewParam(p[0],p[1],p[2],fTempInfo->fQStack[i]);
+ fTempInfo->NewParam(p[0],p[1],p[2],fTempInfo->fQStack[i],fTempInfo->fTimeStack[i]);
fTempInfo->fParam->fVolumeID= volumeID;
fTempInfo->fParam->fTrackID= trackID;
if (i+1<=index2) FlushHitStack2(i+1,index2);
//
Double_t * positionstack = new Double_t[3*(index2-index1+1)];
UInt_t * qstack = new UInt_t[index2-index1+1];
+ Float_t * timestack = new Float_t[index2-index1+1];
memcpy(positionstack, &fTempInfo->fPositionStack[3*index1],
(3*(index2-index1+1))*sizeof(Double_t));
memcpy(qstack, &fTempInfo->fQStack[index1],(index2-index1+1)*sizeof(UInt_t));
+ memcpy(timestack, &fTempInfo->fTimeStack[index1],(index2-index1+1)*sizeof(Float_t));
Double_t *p = positionstack;
for (Int_t j=0; j<=index2-index1;j++){
fTempInfo->fStackIndex++;
- fTempInfo->SetHit(p[3*j+0],p[3*j+1],p[3*j+2],qstack[j]);
+ fTempInfo->SetHit(p[3*j+0],p[3*j+1],p[3*j+2],qstack[j],timestack[j]);
}
delete []positionstack;
delete []qstack;
+ delete []timestack;
}
((AliTPChit*)fHit)->SetY(param->fR*TMath::Sin(param->fFi));
((AliTPChit*)fHit)->SetZ(param->fZ);
((AliTPChit*)fHit)->fQ = param->fCharge[0];
+ ((AliTPChit*)fHit)->fTime = (Float_t)(param->fTime[0]*AliTPCTrackHitsV2::fgkTimePrecision);
/*
fCurrentHit->fHit.fSector = param->fVolumeID;
fCurrentHit->fHit.SetTrack(param->fTrackID);
fCurrentHit->fHit.SetY(param->fR*TMath::Sin(param->fFi));
fCurrentHit->fHit.SetZ(param->fZ);
fCurrentHit->fHit.fQ = param->fCharge[0];
+ fCurrentHit->fHit.fTime = (Float_t)(param->fTime[0]*AliTPCTrackHitsV2::fgkTimePrecision);
*/
fCurrentHit->fR = param->fR;
Double_t z = param->fZ + (param->fTheta*dR+param->fThetaD*dR*dR);
/*
fCurrentHit->fHit.fQ = param->fCharge[fCurrentHit->fStackIndex];
+ fCurrentHit->fHit.fTime = (Float_t)(param->fTime[fCurrentHit->fStackIndex]*AliTPCTrackHitsV2::fgkTimePrecision);
fCurrentHit->fHit.SetX(fCurrentHit->fR*TMath::Cos(fi));
fCurrentHit->fHit.SetY(fCurrentHit->fR*TMath::Sin(fi));
fCurrentHit->fHit.SetZ(z);
fCurrentHit->fHit.SetTrack(param->fTrackID);
*/
((AliTPChit*)fHit)->fQ = param->fCharge[fCurrentHit->fStackIndex];
+ ((AliTPChit*)fHit)->fTime = (Float_t)(param->fTime[fCurrentHit->fStackIndex]*AliTPCTrackHitsV2::fgkTimePrecision);
((AliTPChit*)fHit)->SetX(fCurrentHit->fR*TMath::Cos(fi));
((AliTPChit*)fHit)->SetY(fCurrentHit->fR*TMath::Sin(fi));
((AliTPChit*)fHit)->SetZ(z);
Int_t fNHits; //nuber of thits
Short_t * fHitDistance; //[fNHits] array of hits distances
Short_t * fCharge; //[fNHits] array of charges
+ Short_t * fTime; //[fNHits] array of hits time
static Int_t fgCounter1; //First internal counter
static Int_t fgCounter2; // Second internal counter
void Copy(TObject &) const
{Error("Copy","Not Implemented");}
- ClassDef(AliTrackHitsParamV2,1)
+ ClassDef(AliTrackHitsParamV2,2)
};
{hit.Copy(*this); return (*this);}
void Clear();
void AddHitKartez(Int_t volumeID, Int_t trackID, Double_t x,
- Double_t y, Double_t z,Int_t q);
+ Double_t y, Double_t z,Int_t q,Float_t time);
void AddHit(Int_t volumeID, Int_t trackID, Double_t r,
- Double_t z, Double_t fi,Int_t q);
+ Double_t z, Double_t fi,Int_t q,Float_t time);
Bool_t First(); //set current hit to first hit
Bool_t Next(); //set current hit to next
AliHit * fHit; //! current hit information
static const Double_t fgkPrecision; //precision
static const Double_t fgkPrecision2; //precision
+ static const Double_t fgkTimePrecision; //hit time precision
static Int_t fgCounter1; // First internal counter
static Int_t fgCounter2; // Second internal counter
{Error("Copy","Not Implemented");}
- ClassDef(AliTPCTrackHitsV2,1)
+ ClassDef(AliTPCTrackHitsV2,2)
};
struct AliTPCCurrentHitV2 {
// Called at every step in the Time Projection Chamber
//
Int_t copy, id, i;
- Float_t hits[4];
+ Float_t hits[5];
Int_t vol[2];
TLorentzVector p;
//
hits[3]=0.; // this hit has no energy loss
// new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ // Get also the track time for pileup simulation
+ hits[4]=gMC->TrackTime();
+
AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); // M.I.
gMC->TrackPosition(p);
hits[3]=0.; // this hit has no energy loss
// new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ // Get also the track time for pileup simulation
+ hits[4]=gMC->TrackTime();
+
AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); // M.I.
}
hits[3]=1; //I'd like to have something positive here (I.Belikov)
// new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ // Get also the track time for pileup simulation
+ hits[4]=gMC->TrackTime();
+
AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); // M.I.
}
const Float_t kbig = 1.e10;
Int_t id,copy;
- Float_t hits[4];
+ Float_t hits[5];
Int_t vol[2];
TLorentzVector p;
hits[3]=0.; // this hit has no energy loss
// new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ // Get also the track time for pileup simulation
+ hits[4]=gMC->TrackTime();
+
AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); //MI change
}
hits[3]=0.; // this hit has no energy loss
// new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ // Get also the track time for pileup simulation
+ hits[4]=gMC->TrackTime();
+
AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); //MI change
}
Float_t precision = (momentum>0.1) ? 0.002 :0.01;
fTrackHits->SetHitPrecision(precision);
}
+
+ // Get also the track time for pileup simulation
+ hits[4]=gMC->TrackTime();
+
AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); //MI change
}
Int_t id,copy;
TLorentzVector pos;
- Float_t hits[4];
+ Float_t hits[5];
Int_t vol[2];
vol[1]=0;
hits[1]=pos[1];
hits[2]=pos[2];
+ // Get also the track time for pileup simulation
+ hits[4]=gMC->TrackTime();
+
//
// check the selected side of the TPC
//