////////////////////////////////////////////////////////////////////////////
+#include <TGeoGlobalMagField.h>
#include "AliITSCalibrationSPD.h"
#include "AliITSClusterFinderV2SPD.h"
#include "AliITSRecPoint.h"
#include <TClonesArray.h>
#include "AliITSdigitSPD.h"
#include "AliITSFOSignalsSPD.h"
+#include "AliITSRecPointContainer.h"
+#include "AliMagF.h"
+#include "AliITSsegmentationSPD.h"
ClassImp(AliITSClusterFinderV2SPD)
}
//__________________________________________________________________________
-void AliITSClusterFinderV2SPD::RawdataToClusters(AliRawReader* rawReader, TClonesArray** clusters){
+void AliITSClusterFinderV2SPD::RawdataToClusters(AliRawReader* rawReader){
//------------------------------------------------------------
// This function creates ITS clusters from raw data
//------------------------------------------------------------
rawReader->Reset();
AliITSRawStreamSPD inputSPD(rawReader);
- FindClustersSPD(&inputSPD, clusters);
+ FindClustersSPD(&inputSPD);
}
//__________________________________________________________________________
Int_t AliITSClusterFinderV2SPD::ClustersSPD(AliBin* bins, TClonesArray* digits,TClonesArray* clusters,Int_t maxBins,Int_t nzbins,Int_t iModule,Bool_t rawdata){
//Cluster finder for SPD (from digits and from rawdata)
+ const Double_t kmictocm = 1.0e-4; // convert microns to cm.
+ const Double_t defaultField = 5.0; // default Bz value at which Tan(theta_Lorentz) is given in RecoParam
static AliITSRecoParam *repa = NULL;
if(!repa){
}
const TGeoHMatrix *mT2L=AliITSgeomTGeo::GetTracking2LocalMatrix(iModule);
+ // Lorentz angle correction
+ Double_t tanLorentzAngle=0;
+ AliITSsegmentationSPD *seg = (AliITSsegmentationSPD*)(GetDetTypeRec()->GetSegmentationModel(0));
+ Double_t thick = 0.5*kmictocm*seg->Dy(); // Half Thickness in cm
+ if(repa->GetCorrectLorentzAngleSPD()) { // only if CorrectLorentzAngleSPD required
+ // here retrieve the value of the field
+ AliMagF* field = dynamic_cast<AliMagF*>(TGeoGlobalMagField::Instance()->GetField());
+ if (field == 0)
+ AliError("Cannot get magnetic field from TGeoGlobalMagField");
+ Float_t magField = field->SolenoidField();
+ tanLorentzAngle=repa->GetTanLorentzAngleHolesSPD() * magField / defaultField ;
+ }
+ //
+
if (repa->GetSPDRemoveNoisyFlag()) {
// Loop on noisy pixels and reset them
AliITSCalibrationSPD *cal =
y -= fHwSPD;
z -= fHlSPD;
+ // Lorentz drift effect in local y
+ y -= tanLorentzAngle*thick;
+ //
+
Float_t hit[5]; //y,z,sigma(y)^2, sigma(z)^2, charge
{
Double_t loc[3]={y,0.,z},trk[3]={0.,0.,0.};
}
//__________________________________________________________________________
-void AliITSClusterFinderV2SPD::FindClustersSPD(AliITSRawStreamSPD* input,
- TClonesArray** clusters)
+void AliITSClusterFinderV2SPD::FindClustersSPD(AliITSRawStreamSPD* input)
{
//------------------------------------------------------------
// SPD cluster finder for raw data (this method is called once per event)
// Now also fills fast-or fired map
//------------------------------------------------------------
-
+
+ AliITSRecPointContainer* rpc = AliITSRecPointContainer::Instance();
Int_t nClustersSPD = 0;
Int_t kNzBins = fNzSPD + 2;
Int_t kNyBins = fNySPD + 2;
// when all data from a module was read, search for clusters
if (bins) {
- clusters[iModule] = new TClonesArray("AliITSRecPoint");
- Int_t nClusters = ClustersSPD(bins,0,clusters[iModule],kMaxBin,kNzBins,iModule,kTRUE);
+ TClonesArray* clusters = rpc->UncheckedGetClusters(iModule);
+ Int_t nClusters = ClustersSPD(bins,0,clusters,kMaxBin,kNzBins,iModule,kTRUE);
nClustersSPD += nClusters;
bins = NULL;
}
delete [] binsSPDInit;
delete [] binsSPD;
- // AliDebug(1,Form("found clusters in ITS SPD: %d", nClustersSPD));
- Info("FindClustersSPD", "found clusters in ITS SPD: %d", nClustersSPD);
+ AliDebug(1,Form("found clusters in ITS SPD: %d", nClustersSPD));
+
// Fill the FastOr fired map
for (UInt_t eq=0; eq<20; eq++) {