X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSReconstructor.cxx;h=3d7129fea835f4a0678f732f370763369e6728c5;hb=4c0fc8e0f2ecdc0f0d1580a74e1ad8523e85faf0;hp=affa4fbdff0713924e7b32bd4ebc171d500febe2;hpb=121a60bdc4a48622b049b36c1fd6bbaea265c3e5;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSReconstructor.cxx b/ITS/AliITSReconstructor.cxx index affa4fbdff0..3d7129fea83 100644 --- a/ITS/AliITSReconstructor.cxx +++ b/ITS/AliITSReconstructor.cxx @@ -21,163 +21,243 @@ // // /////////////////////////////////////////////////////////////////////////////// - +#include "Riostream.h" #include "AliITSReconstructor.h" -#include "AliRunLoader.h" -#include "AliITSclustererV2.h" +#include "AliRun.h" +#include "AliRawReader.h" +#include "AliESDEvent.h" +#include "AliESDpid.h" +#include "AliITSgeom.h" +#include "AliITSLoader.h" +#include "AliITStrackerMI.h" +#include "AliITStrackerV2.h" #include "AliITStrackerSA.h" -#include "AliITSVertexerIons.h" #include "AliITSVertexerFast.h" -#include "AliITSVertexerPPZ.h" +#include "AliITSVertexerFixed.h" +#include "AliITSVertexer3D.h" #include "AliITSVertexerZ.h" -#include "AliESD.h" -#include "AliITSpidESD.h" -#include "AliV0vertexer.h" -#include "AliCascadeVertexer.h" -#include "AliRun.h" -#include "AliITS.h" - +#include "AliITSVertexerZD.h" +#include "AliITSVertexerCosmics.h" +#include "AliITSInitGeometry.h" +#include "AliITSTrackleterSPDEff.h" +#include "AliITSMultReconstructor.h" ClassImp(AliITSReconstructor) - -//_____________________________________________________________________________ -void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const +//___________________________________________________________________________ +AliITSReconstructor::AliITSReconstructor() : AliReconstructor(), +fDetTypeRec(0) { -// reconstruct clusters + // Default constructor +} + //___________________________________________________________________________ +AliITSReconstructor::~AliITSReconstructor(){ +// destructor + if(fDetTypeRec) delete fDetTypeRec; +} +//____________________________________________________________________________ +void AliITSReconstructor::GetPidSettings(AliESDpid *ESDpid) { + // + // pass PID settings from AliITSRecoParam to AliESDpid + // + Int_t pidOpt = GetRecoParam()->GetPID(); - AliLoader* loader = runLoader->GetLoader("ITSLoader"); - if (!loader) { - Error("Reconstruct", "ITS loader not found"); - return; + if(pidOpt==1){ + AliDebug(1,"ITS LandauFitPID option has been selected\n"); + ESDpid->SetITSPIDmethod(AliESDpid::kITSLikelihood); } - loader->LoadRecPoints("recreate"); - loader->LoadDigits("read"); - runLoader->LoadKinematics(); - - AliITSgeom* geom = GetITSgeom(runLoader); - if (!geom) return; - AliITSclustererV2 clusterer(geom); - Int_t nEvents = runLoader->GetNumberOfEvents(); - - for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) { - runLoader->GetEvent(iEvent); - - TTree* treeClusters = loader->TreeR(); - if (!treeClusters) { - loader->MakeTree("R"); - treeClusters = loader->TreeR(); - } - TTree* treeDigits = loader->TreeD(); - if (!treeDigits) { - Error("Reconstruct", "Can't get digits tree !"); - return; - } - - clusterer.Digits2Clusters(treeDigits, treeClusters); - - loader->WriteRecPoints("OVERWRITE"); + else{ + AliDebug(1,"ITS default PID\n"); + ESDpid->SetITSPIDmethod(AliESDpid::kITSTruncMean); } +} +//______________________________________________________________________ +void AliITSReconstructor::Init() { + // Initalize this constructor bet getting/creating the objects + // nesseary for a proper ITS reconstruction. + // Inputs: + // none. + // Output: + // none. + // Return: + // none. + + AliITSInitGeometry initgeom; + AliITSgeom *geom = initgeom.CreateAliITSgeom(); + AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data())); - loader->UnloadRecPoints(); - loader->UnloadDigits(); - runLoader->UnloadKinematics(); + fDetTypeRec = new AliITSDetTypeRec(); + fDetTypeRec->SetITSgeom(geom); + fDetTypeRec->SetDefaults(); + + return; } //_____________________________________________________________________________ -AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader) const +void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const { -// create a ITS tracker +// reconstruct clusters - AliITSgeom* geom = GetITSgeom(runLoader); - if (!geom) return NULL; - return new AliITStrackerSA(geom); + Int_t cluFindOpt = GetRecoParam()->GetClusterFinder(); + TString recopt = GetRecoParam()->GetOptReco(); + fDetTypeRec->SetTreeAddressD(digitsTree); + fDetTypeRec->MakeBranch(clustersTree,"R"); + fDetTypeRec->SetTreeAddressR(clustersTree); + fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,recopt.Data(),cluFindOpt); } -//_____________________________________________________________________________ -AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const +//_________________________________________________________________ +void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const { -// create a ITS vertexer + // reconstruct clusters from raw data + TString recopt = GetRecoParam()->GetOptReco(); + fDetTypeRec->SetDefaultClusterFindersV2(kTRUE); + fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree,recopt.Data()); +} - TString selectedVertexer(" "); - if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){ - Info("CreateVertexer","a AliITSVertexerIons object has been selected\n"); - return new AliITSVertexerIons("null"); - } - if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){ - Double_t smear[3]={0.005,0.005,0.01}; - Info("CreateVertexer","a AliITSVertexerFast object has been selected\n"); - return new AliITSVertexerFast(smear); - } - if(selectedVertexer.Contains("ppz") || selectedVertexer.Contains("PPZ")){ - Info("CreateVertexer","a AliITSVertexerPPZ object has been selected\n"); - return new AliITSVertexerPPZ("null"); - } - // by default an AliITSVertexerZ object is instatiated - Info("CreateVertexer","a AliITSVertexerZ object has been selected\n"); - return new AliITSVertexerZ("null"); +//_____________________________________________________________________________ +AliTrackleter* AliITSReconstructor::CreateMultFinder() const +{ + // create the SPD trackeleter for mult. reconstruction + AliITSMultReconstructor* multReco = new AliITSMultReconstructor(); + multReco->SetHistOn(kFALSE); + multReco->SetDetTypeRec(fDetTypeRec); + return multReco; } //_____________________________________________________________________________ -void AliITSReconstructor::FillESD(AliRunLoader* /*runLoader*/, - AliESD* esd) const +AliTracker* AliITSReconstructor::CreateTrackleter() const { -// make PID, find V0s and cascades - - Double_t parITS[] = {34., 0.15, 10.}; - AliITSpidESD itsPID(parITS); - itsPID.MakePID(esd); - - // V0 finding - Double_t cuts[]={33, // max. allowed chi2 - 0.16,// min. allowed negative daughter's impact parameter - 0.05,// min. allowed positive daughter's impact parameter - 0.08,// max. allowed DCA between the daughter tracks - 0.99,// max. allowed cosine of V0's pointing angle - 0.9, // min. radius of the fiducial volume - 2.9 // max. radius of the fiducial volume - }; - AliV0vertexer vtxer(cuts); - Double_t vtx[3], cvtx[6]; - esd->GetVertex()->GetXYZ(vtx); - esd->GetVertex()->GetSigmaXYZ(cvtx); - vtxer.SetVertex(vtx); - vtxer.Tracks2V0vertices(esd); - - // cascade finding - Double_t cts[]={33., // max. allowed chi2 - 0.05, // min. allowed V0 impact parameter - 0.008, // window around the Lambda mass - 0.035, // min. allowed bachelor's impact parameter - 0.10, // max. allowed DCA between a V0 and a track - 0.9985, //max. allowed cosine of the cascade pointing angle - 0.9, // min. radius of the fiducial volume - 2.9 // max. radius of the fiducial volume - }; - AliCascadeVertexer cvtxer=AliCascadeVertexer(cts); - cvtxer.SetVertex(vtx); - cvtxer.V0sTracks2CascadeVertices(esd); +// create the SPD trackeleter (for SPD PlaneEfficiency evaluation) + if(!GetRecoParam()->GetComputePlaneEff() || !GetRecoParam()->GetUseTrackletsPlaneEff()) return NULL; + //Int_t trackerOpt = GetRecoParam()->GetTracker(); + AliTracker* trackleter; + trackleter = new AliITSTrackleterSPDEff(); + AliITSTrackleterSPDEff *spdtrackleter=(AliITSTrackleterSPDEff*)trackleter; + // here set cuts (from RecoParam) + if(GetRecoParam()->GetBkgTrackletsPlaneEff()) spdtrackleter->SetReflectClusterAroundZAxisForLayer(1,kTRUE); + if(GetRecoParam()->GetMCTrackletsPlaneEff()) spdtrackleter->SetMC(); + spdtrackleter->SetHistOn(); + spdtrackleter->SetPhiWindowL2(GetRecoParam()->GetTrackleterPhiWindowL2()); + spdtrackleter->SetZetaWindowL2(GetRecoParam()->GetTrackleterZetaWindowL2()); + spdtrackleter->SetPhiWindowL1(GetRecoParam()->GetTrackleterPhiWindowL1()); + spdtrackleter->SetZetaWindowL1(GetRecoParam()->GetTrackleterZetaWindowL1()); + if(GetRecoParam()->GetUpdateOncePerEventPlaneEff()) spdtrackleter->SetUpdateOncePerEventPlaneEff(); + spdtrackleter->SetMinContVtx(GetRecoParam()->GetMinContVtxPlaneEff()); + return trackleter; } +//_____________________________________________________________________________ +AliTracker* AliITSReconstructor::CreateTracker() const +{ +// create a ITS tracker + + Int_t trackerOpt = GetRecoParam()->GetTracker(); + AliTracker* tracker; + if (trackerOpt==1) { + tracker = new AliITStrackerMI(0); + AliITStrackerMI *mit=(AliITStrackerMI*)tracker; + mit->SetDetTypeRec(fDetTypeRec); + } + else if (trackerOpt==2) { + tracker = new AliITStrackerV2(0); + } + else { + tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI + AliITStrackerSA *sat=(AliITStrackerSA*)tracker; + sat->SetDetTypeRec(fDetTypeRec); + if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE); + if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n"); + if(GetRecoParam()->GetInwardFindingSA()){ + sat->SetInwardFinding(); + sat->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA()); + }else{ + sat->SetOutwardFinding(); + sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA()); + } + sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA()); + } + + return tracker; + +} //_____________________________________________________________________________ -AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const +AliVertexer* AliITSReconstructor::CreateVertexer() const { -// get the ITS geometry +// create a ITS vertexer - if (!runLoader->GetAliRun()) runLoader->LoadgAlice(); - if (!runLoader->GetAliRun()) { - Error("GetITSgeom", "couldn't get AliRun object"); - return NULL; + AliITSVertexer *vptr = NULL; + Int_t vtxOpt = GetRecoParam()->GetVertexer(); + if(vtxOpt==3){ + AliFatal("Option AliITSVertexerIons is no longer supported"); + return vptr; + } + else if(vtxOpt==4){ + Double_t smear[3]={GetRecoParam()->GetVertexerFastSmearX(), + GetRecoParam()->GetVertexerFastSmearY(), + GetRecoParam()->GetVertexerFastSmearZ()}; + AliDebug(1,"AliITSVertexerFast has been selected"); + vptr = new AliITSVertexerFast(smear); + } + else if(vtxOpt==1){ + AliDebug(1,"AliITSVertexerZ has been selected"); + AliITSVertexerZ* vtxrz = new AliITSVertexerZ(); + Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo(); + if(pileupAlgo==3) vtxrz->SetSearchForPileup(kFALSE); + vptr = vtxrz; + } + else if(vtxOpt==2){ + AliDebug(1,"AliITSVertexerCosmics has been selected"); + vptr = new AliITSVertexerCosmics(); + } + else if(vtxOpt==5){ + AliDebug(1,"Vertex is fixed in the position of the TDI\n"); + vptr = new AliITSVertexerFixed("TDI"); } - AliITS* its = (AliITS*) runLoader->GetAliRun()->GetDetector("ITS"); - if (!its) { - Error("GetITSgeom", "couldn't get ITS detector"); - return NULL; + else if(vtxOpt==6){ + AliDebug(1,"Vertex is fixed in the position of the TED\n"); + vptr = new AliITSVertexerFixed("TED"); } - if (!its->GetITSgeom()) { - Error("GetITSgeom", "no ITS geometry available"); - return NULL; + else if(vtxOpt==7){ + AliDebug(1,"VertexerZD: reconstruction of the Z coordinate with SDD \n"); + AliITSVertexerZD*vtxrz = new AliITSVertexerZD(); + vtxrz->SetSearchForPileup(kFALSE); + vptr = vtxrz; } - return its->GetITSgeom(); + else { + // by default an AliITSVertexer3D object is instatiated + AliITSVertexer3D* vtxr = + new AliITSVertexer3D(GetRecoParam()->GetVertexer3DWideFiducialRegionZ()); + Float_t dzw=GetRecoParam()->GetVertexer3DWideFiducialRegionZ(); + Float_t drw=GetRecoParam()->GetVertexer3DWideFiducialRegionR(); + vtxr->SetWideFiducialRegion(dzw,drw); + Float_t dzn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionZ(); + Float_t drn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionR(); + vtxr->SetNarrowFiducialRegion(dzn,drn); + Float_t dphil=GetRecoParam()->GetVertexer3DLooseDeltaPhiCut(); + Float_t dphit=GetRecoParam()->GetVertexer3DTightDeltaPhiCut(); + vtxr->SetDeltaPhiCuts(dphil,dphit); + Float_t dcacut=GetRecoParam()->GetVertexer3DDCACut(); + vtxr->SetDCACut(dcacut); + Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo(); + vtxr->SetPileupAlgo(pileupAlgo); + UChar_t highmultAlgo=GetRecoParam()->GetSPDVertexerHighMultAlgo(); + vtxr->SetHighMultAlgo(highmultAlgo); + AliDebug(1,Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo)); + vptr = vtxr; + } + vptr->SetDetTypeRec(fDetTypeRec); + return vptr; +} + +//_____________________________________________________________________________ +void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree * /*clustersTree*/, + AliESDEvent* /* esd */) const +{ +// make PID, find V0s and cascade +/* Now done in AliESDpid + if(fItsPID!=0) fItsPID->MakePID(esd); + else AliError("!! cannot do the PID !!"); +*/ }