X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSReconstructor.cxx;h=a634b5d8d3ccf365471ba0ed3496195b9bd421f6;hb=7cae5b4e326421d81102dc1525bc853fe1e21d8e;hp=9614b0a24dd9384cb451fea5151ed687de2d75d3;hpb=3acc14d5a3b4812d716b8369507c395fe4b3060a;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSReconstructor.cxx b/ITS/AliITSReconstructor.cxx index 9614b0a24dd..a634b5d8d3c 100644 --- a/ITS/AliITSReconstructor.cxx +++ b/ITS/AliITSReconstructor.cxx @@ -24,9 +24,9 @@ #include "Riostream.h" #include "AliITSReconstructor.h" #include "AliRun.h" -#include "AliRunLoader.h" #include "AliRawReader.h" #include "AliITSDetTypeRec.h" +#include "AliITSgeom.h" #include "AliITSLoader.h" #include "AliITStrackerMI.h" #include "AliITStrackerV2.h" @@ -36,28 +36,40 @@ #include "AliITSVertexer3D.h" #include "AliITSVertexerZ.h" #include "AliITSVertexerCosmics.h" -#include "AliESD.h" +#include "AliESDEvent.h" #include "AliITSpidESD.h" #include "AliITSpidESD1.h" #include "AliITSpidESD2.h" #include "AliITSInitGeometry.h" + ClassImp(AliITSReconstructor) +AliITSRecoParam *AliITSReconstructor::fgkRecoParam =0; // reconstruction parameters + //___________________________________________________________________________ AliITSReconstructor::AliITSReconstructor() : AliReconstructor(), -fItsPID(0) +fItsPID(0), +fDetTypeRec(0) { // Default constructor + if (!fgkRecoParam) { + AliError("The Reconstruction parameters nonitialized - Used default one"); + fgkRecoParam = AliITSRecoParam::GetHighFluxParam(); + } } //___________________________________________________________________________ AliITSReconstructor::~AliITSReconstructor(){ // destructor delete fItsPID; + if(fgkRecoParam) delete fgkRecoParam; + if(fDetTypeRec) delete fDetTypeRec; } //______________________________________________________________________ AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob), -fItsPID(ob.fItsPID) + fItsPID(ob.fItsPID), + fDetTypeRec(ob.fDetTypeRec) + { // Copy constructor } @@ -69,14 +81,13 @@ AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& new(this) AliITSReconstructor(ob); return *this; } + //______________________________________________________________________ -void AliITSReconstructor::Init(AliRunLoader *runLoader) const{ +void AliITSReconstructor::Init() { // Initalize this constructor bet getting/creating the objects // nesseary for a proper ITS reconstruction. // Inputs: - // AliRunLoader *runLoader Pointer to the run loader to allow - // the getting of files/folders data - // needed to do reconstruction + // none. // Output: // none. // Return: @@ -85,83 +96,40 @@ void AliITSReconstructor::Init(AliRunLoader *runLoader) const{ AliITSInitGeometry initgeom; AliITSgeom *geom = initgeom.CreateAliITSgeom(); AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data())); - AliITSLoader* loader = static_cast - (runLoader->GetLoader("ITSLoader")); - if (!loader) { - Error("Init", "ITS loader not found"); - return; - } - loader->SetITSgeom(geom); + + fDetTypeRec = new AliITSDetTypeRec(); + fDetTypeRec->SetITSgeom(geom); + fDetTypeRec->SetDefaults(); + return; } + //_____________________________________________________________________________ -void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const +void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const { // reconstruct clusters - - AliITSLoader* loader = static_cast(runLoader->GetLoader("ITSLoader")); - if (!loader) { - Error("Reconstruct", "ITS loader not found"); - return; - } - AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader); - rec->SetDefaults(); - - loader->LoadRecPoints("recreate"); - loader->LoadDigits("read"); - runLoader->LoadKinematics(); TString option = GetOption(); Bool_t clusfinder=kTRUE; // Default: V2 cluster finder if(option.Contains("OrigCF"))clusfinder=kFALSE; - Int_t nEvents = runLoader->GetNumberOfEvents(); - - for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) { - runLoader->GetEvent(iEvent); - if(loader->TreeR()==0x0) loader->MakeTree("R"); - rec->MakeBranch("R"); - rec->SetTreeAddress(); - rec->DigitsToRecPoints(iEvent,0,"All",clusfinder); - } - - loader->UnloadRecPoints(); - loader->UnloadDigits(); - runLoader->UnloadKinematics(); + fDetTypeRec->SetTreeAddressD(digitsTree); + fDetTypeRec->MakeBranch(clustersTree,"R"); + fDetTypeRec->SetTreeAddressR(clustersTree); + fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",clusfinder); } //_________________________________________________________________ -void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader, - AliRawReader* rawReader) const +void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const { -// reconstruct clusters - + // reconstruct clusters from raw data - AliITSLoader* loader = static_cast(runLoader->GetLoader("ITSLoader")); - if (!loader) { - Error("Reconstruct", "ITS loader not found"); - return; - } - - AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader); - rec->SetDefaults(); - rec->SetDefaultClusterFindersV2(kTRUE); - - loader->LoadRecPoints("recreate"); - - Int_t iEvent = 0; - - while(rawReader->NextEvent()) { - runLoader->GetEvent(iEvent++); - if(loader->TreeR()==0x0) loader->MakeTree("R"); - rec->DigitsToRecPoints(rawReader); - } - - loader->UnloadRecPoints(); + fDetTypeRec->SetDefaultClusterFindersV2(kTRUE); + fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree); } //_____________________________________________________________________________ -AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader)const +AliTracker* AliITSReconstructor::CreateTracker() const { // create a ITS tracker @@ -179,26 +147,28 @@ AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader)const AliITStrackerSA *sat=(AliITStrackerSA*)tracker; if(selectedTracker.Contains("onlyITS"))sat->SetSAFlag(kTRUE); if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n"); + if(selectedTracker.Contains("cosmics")||selectedTracker.Contains("COSMICS")) + sat->SetOuterStartLayer(AliITSgeomTGeo::GetNLayers()-2); } TString selectedPIDmethod = GetOption(); - AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); - if (!loader) { - Error("CreateTracker", "ITS loader not found"); - } + AliITSReconstructor* nc = const_cast(this); if(selectedPIDmethod.Contains("LandauFitPID")){ - loader->AdoptITSpid(new AliITSpidESD2((AliITStrackerMI*)tracker,loader)); + Info("FillESD","ITS LandauFitPID option has been selected\n"); + nc->fItsPID = new AliITSpidESD2((AliITStrackerMI*)tracker); } else{ - Double_t parITS[] = {34., 0.15, 10.}; - loader->AdoptITSpid(new AliITSpidESD1(parITS)); + Info("FillESD","ITS default PID\n"); + Double_t parITS[] = {79.,0.13, 5.}; //IB: this is "pp tuning" + nc->fItsPID = new AliITSpidESD1(parITS); } + return tracker; } //_____________________________________________________________________________ -AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const +AliVertexer* AliITSReconstructor::CreateVertexer() const { // create a ITS vertexer @@ -226,46 +196,20 @@ AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) co } //_____________________________________________________________________________ -void AliITSReconstructor::FillESD(AliRunLoader* runLoader, - AliESD* esd) const +void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree *clustersTree, + AliESDEvent* esd) const { // make PID, find V0s and cascade - AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); - AliITSpidESD *pidESD = 0; - TString selectedPIDmethod = GetOption(); - if(selectedPIDmethod.Contains("LandauFitPID")){ - Info("FillESD","ITS LandauFitPID option has been selected\n"); - pidESD=loader->GetITSpid(); - } - else{ - Info("FillESD","ITS default PID\n"); - pidESD=loader->GetITSpid(); - } - if(pidESD!=0){ - pidESD->MakePID(esd); + if(fItsPID!=0) { + TString selectedPIDmethod = GetOption(); + if(selectedPIDmethod.Contains("LandauFitPID")){ + fItsPID->MakePID(clustersTree,esd); + } + else{ + fItsPID->MakePID(esd); + } } else { Error("FillESD","!! cannot do the PID !!\n"); } } - - -//_____________________________________________________________________________ -AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const -{ -// get the ITS geometry - - if (!runLoader->GetAliRun()) runLoader->LoadgAlice(); - if (!runLoader->GetAliRun()) { - Error("GetITSgeom", "couldn't get AliRun object"); - return NULL; - } - AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); - AliITSgeom* geom = (AliITSgeom*)loader->GetITSgeom(); - if(!geom){ - Error("GetITSgeom","no ITS geometry available"); - return NULL; - } - - return geom; -}