//#define DEBUG
+using std::endl;
+using std::cout;
ClassImp(AliITSsimulationSPD)
////////////////////////////////////////////////////////////////////////
// Version: 1
} else {
fCoupling=1;
} // end if
- //SetLorentzDrift(kTRUE);
- if (fLorentz) SetTanLorAngle();
+ SetLorentzDrift(simpar->GetSPDLorentzDrift());
+ if (fLorentz) SetTanLorAngle(simpar->GetSPDLorentzHoleWeight());
//SetStrobeGeneration(kFALSE);
if (fStrobe) GenerateStrobePhase();
}
}
Double_t WeightEle=1.-WeightHole;
AliITSSimuParam* simpar = fDetType->GetSimuParam();
- Double_t pos[3]={0.,0.,0.};
- Double_t B[3]={0.,0.,0.};
- TGeoGlobalMagField::Instance()->Field(pos,B);
- fTanLorAng = TMath::Tan(WeightHole*simpar->LorentzAngleHole(B[2]) +
- WeightEle*simpar->LorentzAngleElectron(B[2]));
- fTanLorAng*=-1.; // this only for the old geometry
- // comment the upper line for the new geometry
+ AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ if (!fld) AliFatal("The field is not initialized");
+ Double_t bz = fld->SolenoidField();
+ fTanLorAng = TMath::Tan(WeightHole*simpar->LorentzAngleHole(bz) +
+ WeightEle*simpar->LorentzAngleElectron(bz));
return kTRUE;
}
//______________________________________________________________________
if(GetMap()->GetpListItem(i)==0) continue;
else{
GetMap()->GetMapIndex(GetMap()->GetpListItem(i)->GetIndex(),iz,ix);
- SetCoupling(iz,ix,idtrack,h);
+ SetCoupling(iz,ix);
} // end for i
break;
case 2: // case 4:
if(GetMap()->GetpListItem(i)==0) continue;
else{
GetMap()->GetMapIndex(GetMap()->GetpListItem(i)->GetIndex(),iz,ix);
- SetCouplingOld(iz,ix,idtrack,h);
+ SetCouplingOld(iz,ix);
} // end for i
break;
} // end switch
if(GetMap()->GetpListItem(i)==0) continue;
else{
GetMap()->GetMapIndex(GetMap()->GetpListItem(i)->GetIndex(),iz,ix);
- SetCoupling(iz,ix,idtrack,h);
+ SetCoupling(iz,ix);
} // end for i
break;
case 2: // case 4:
if(GetMap()->GetpListItem(i)==0) continue;
else{
GetMap()->GetMapIndex(GetMap()->GetpListItem(i)->GetIndex(),iz,ix);
- SetCouplingOld(iz,ix,idtrack,h);
+ SetCouplingOld(iz,ix);
} // end for i
break;
} // end switch
fSPDname="spd_";
for(Int_t i=0;i<GetNPixelsZ();i++) {
Char_t pixelz[4];
- sprintf(pixelz,"%d",i);
+ snprintf(pixelz,3,"%d",i);
fSPDname.Append(pixelz);
fHis->AddAt(new TH1F(fSPDname.Data(),"SPD maps",
GetNPixelsX(),0.,(Double_t)GetNPixelsX()),i);
}
//______________________________________________________________________
-void AliITSsimulationSPD::SetCoupling(Int_t col, Int_t row, Int_t ntrack,
- Int_t idhit) {
+void AliITSsimulationSPD::SetCoupling(Int_t col, Int_t row) {
// Take into account the coupling between adiacent pixels.
// The parameters probcol and probrow are the probability of the
// signal in one pixel shared in the two adjacent pixels along
// Inputs:
// Int_t col z cell index
// Int_t row x cell index
- // Int_t ntrack track incex number
- // Int_t idhit hit index number
// Outputs:
// none.
// Return:
Double_t xr=0.;
GetCouplings(couplC,couplR);
- if(GetDebug(3)) Info("SetCoupling","(col=%d,row=%d,ntrack=%d,idhit=%d) "
+ if(GetDebug(3)) Info("SetCoupling","(col=%d,row=%d) "
"Calling SetCoupling couplC=%e couplR=%e",
- col,row,ntrack,idhit,couplC,couplR);
+ col,row,couplC,couplR);
j1 = col;
j2 = row;
pulse1 = GetMap()->GetSignalOnly(col,row);
j1 = col;
flag = 1;
}else{
- UpdateMapSignal(row,j1,ntrack,idhit,pulse1);
+ UpdateMapNoise(row,j1,pulse1);
// flag = 0;
flag = 1; // only first next!!
} // end if
j2 = row;
flag = 1;
}else{
- UpdateMapSignal(j2,col,ntrack,idhit,pulse2);
+ UpdateMapNoise(j2,col,pulse2);
// flag = 0;
flag = 1; // only first next!!
} // end if
} // for isign
}
//______________________________________________________________________
-void AliITSsimulationSPD::SetCouplingOld(Int_t col, Int_t row,
- Int_t ntrack,Int_t idhit) {
+void AliITSsimulationSPD::SetCouplingOld(Int_t col, Int_t row) {
// Take into account the coupling between adiacent pixels.
// The parameters probcol and probrow are the fractions of the
// signal in one pixel shared in the two adjacent pixels along
// Inputs:
// Int_t col z cell index
// Int_t row x cell index
- // Int_t ntrack track incex number
- // Int_t idhit hit index number
// Int_t module module number
// Outputs:
// none.
// cout << "Threshold --> " << GetThreshold() << endl; // dom
// cout << "Couplings --> " << couplC << " " << couplR << endl; // dom
- if(GetDebug(3)) Info("SetCouplingOld","(col=%d,row=%d,ntrack=%d,idhit=%d) "
+ if(GetDebug(3)) Info("SetCouplingOld","(col=%d,row=%d) "
"Calling SetCoupling couplC=%e couplR=%e",
- col,row,ntrack,idhit,couplC,couplR);
+ col,row,couplC,couplR);
for (Int_t isign=-1;isign<=1;isign+=2){// loop in col direction
pulse1 = GetMap()->GetSignalOnly(col,row);
pulse2 = pulse1;
j1 = col;
flag = 1;
}else{
- UpdateMapSignal(row,j1,ntrack,idhit,pulse1);
+ UpdateMapNoise(row,j1,pulse1);
// flag = 0;
flag = 1; // only first next !!
} // end if
j2 = row;
flag = 1;
}else{
- UpdateMapSignal(j2,col,ntrack,idhit,pulse2);
+ UpdateMapNoise(j2,col,pulse2);
// flag = 0;
flag = 1; // only first next!!
} // end if