X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSVertexer.cxx;h=be766592b2f2a35ecf10e52a2e4eca1cbc621461;hb=37a5022f15e085a9ce823af627893f085d652fac;hp=a5aa8759de53daa99c3ef7ab96002e23df622999;hpb=8c42830aca873140dd76a85c8b80080378cb378b;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSVertexer.cxx b/ITS/AliITSVertexer.cxx index a5aa8759de5..be766592b2f 100644 --- a/ITS/AliITSVertexer.cxx +++ b/ITS/AliITSVertexer.cxx @@ -1,9 +1,12 @@ #include "AliLog.h" #include "AliMultiplicity.h" #include "AliITSgeomTGeo.h" +#include "AliITSDetTypeRec.h" #include "AliITSVertexer.h" #include "AliITSLoader.h" #include "AliITSMultReconstructor.h" +#include "AliITSRecPointContainer.h" +#include "AliRunLoader.h" const Float_t AliITSVertexer::fgkPipeRadius = 3.0; @@ -12,7 +15,7 @@ ClassImp(AliITSVertexer) ////////////////////////////////////////////////////////////////////// // Base class for primary vertex reconstruction // // AliESDVertexer is a class for full 3D primary vertex finding // -// derived classes: AliITSVertexerIons AliITSvertexer3D // +// derived classes: AliITSvertexer3D, AliITSVertexerZ. // // AliITSVertexerCosmics // ////////////////////////////////////////////////////////////////////// @@ -20,36 +23,71 @@ ClassImp(AliITSVertexer) //______________________________________________________________________ AliITSVertexer::AliITSVertexer():AliVertexer(), -fLadders(), +fLadders(NULL), fLadOnLay2(0), +fComputeMultiplicity(kFALSE), +fDetTypeRec(NULL), +fMinTrackletsForPilup(0), +fIsPileup(0), +fNTrpuv(-2), +fZpuv(-9999999.), +fNoVertices(0), +fVertArray(NULL), fFirstEvent(0), fLastEvent(-1) { // Default Constructor SetLaddersOnLayer2(); + SetMinTrackletsForPilup(); for(Int_t i=0; i 0){ + if(fVertArray) delete []fVertArray; + fVertArray = NULL; + fNoVertices = 0; + } + fIsPileup=kFALSE; + fNTrpuv=-2; + fZpuv=-99999.; + +} //______________________________________________________________________ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){ // Invokes AliITSMultReconstructor to determine the // charged multiplicity in the pixel layers if(fMult){delete fMult; fMult = 0;} + Bool_t success=kTRUE; + Bool_t cosmics=kFALSE; if(!fCurrentVertex)success=kFALSE; if(fCurrentVertex && fCurrentVertex->GetNContributors()<1)success=kFALSE; - + if(fCurrentVertex && strstr(fCurrentVertex->GetTitle(),"cosmics")) { + success=kFALSE; + cosmics=kTRUE; + } + + // get the FastOr bit mask + TBits fastOrFiredMap = fDetTypeRec->GetFastOrFiredMap(); + TBits firedChipMap = fDetTypeRec->GetFiredChipMap(itsClusterTree); + AliITSMultReconstructor multReco; if(!success){ - AliWarning("Tracklets multiplicity not determined because the primary vertex was not found"); - AliWarning("Just counting the number of cluster-fired chips on the SPD layers"); + if(!cosmics) { + AliDebug(1,"Tracklets multiplicity not determined because the primary vertex was not found"); + AliDebug(1,"Just counting the number of cluster-fired chips on the SPD layers"); + } if (!itsClusterTree) { AliError(" Invalid ITS cluster tree !\n"); return; @@ -57,7 +95,13 @@ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){ multReco.LoadClusterFiredChips(itsClusterTree); Short_t nfcL1 = multReco.GetNFiredChips(0); Short_t nfcL2 = multReco.GetNFiredChips(1); - fMult = new AliMultiplicity(0,0,0,0,0,0,0,0,0,nfcL1,nfcL2); + fMult = new AliMultiplicity(0,0,0,0,0,0,0,0,0,0,0,nfcL1,nfcL2,fastOrFiredMap); + fMult->SetFiredChipMap(firedChipMap); + AliITSRecPointContainer* rcont = AliITSRecPointContainer::Instance(); + fMult->SetITSClusters(0,rcont->GetNClustersInLayer(1,itsClusterTree)); + for(Int_t kk=2;kk<=6;kk++){ + fMult->SetITSClusters(kk-1,rcont->GetNClustersInLayerFast(kk)); + } return; } @@ -74,34 +118,45 @@ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){ Int_t notracks=multReco.GetNTracklets(); Float_t *tht = new Float_t [notracks]; Float_t *phi = new Float_t [notracks]; + Float_t *dtht = new Float_t [notracks]; Float_t *dphi = new Float_t [notracks]; Int_t *labels = new Int_t[notracks]; Int_t *labelsL2 = new Int_t[notracks]; for(Int_t i=0;i(multReco.GetTracklet(i)[3]); - labelsL2[i] = static_cast(multReco.GetTracklet(i)[4]); + labels[i] = static_cast(multReco.GetTracklet(i)[4]); + labelsL2[i] = static_cast(multReco.GetTracklet(i)[5]); } Int_t nosingleclus=multReco.GetNSingleClusters(); Float_t *ths = new Float_t [nosingleclus]; Float_t *phs = new Float_t [nosingleclus]; + Int_t *labelss = new Int_t [nosingleclus]; for(Int_t i=0;iSetFiredChipMap(firedChipMap); + AliITSRecPointContainer* rcont = AliITSRecPointContainer::Instance(); + fMult->SetITSClusters(0,rcont->GetNClustersInLayer(1,itsClusterTree)); + for(Int_t kk=2;kk<=6;kk++){ + fMult->SetITSClusters(kk-1,rcont->GetNClustersInLayerFast(kk)); + } delete [] tht; delete [] phi; + delete [] dtht; delete [] dphi; delete [] ths; delete [] phs; delete [] labels; delete [] labelsL2; + delete [] labelss; return; } @@ -110,6 +165,7 @@ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){ void AliITSVertexer::SetLaddersOnLayer2(Int_t ladwid){ // Calculates the array of ladders on layer 2 to be used with a // given ladder on layer 1 + if(ladwid == fLadOnLay2 && fLadders)return; fLadOnLay2=ladwid; Int_t ladtot1=AliITSgeomTGeo::GetNLadders(1); if(fLadders) delete [] fLadders; @@ -145,15 +201,15 @@ void AliITSVertexer::SetLaddersOnLayer2(Int_t ladwid){ } } -#include "AliRunLoader.h" //______________________________________________________________________ void AliITSVertexer::Init(TString filename){ // Initialize the vertexer in case of // analysis of an entire file - AliRunLoader *rl = AliRunLoader::GetRunLoader(); + AliRunLoader *rl = AliRunLoader::Instance(); if(!rl){ - Fatal("AliITSVertexer","Run Loader not found"); + AliFatal("Run Loader not found"); + return; } if (fLastEvent < 0) SetLastEvent(rl->GetNumberOfEvents()-1); @@ -165,20 +221,20 @@ void AliITSVertexer::Init(TString filename){ //______________________________________________________________________ void AliITSVertexer::WriteCurrentVertex(){ // Write the current AliVertex object to file fOutFile - AliRunLoader *rl = AliRunLoader::GetRunLoader(); + AliRunLoader *rl = AliRunLoader::Instance(); AliITSLoader* itsLoader = (AliITSLoader*) rl->GetLoader("ITSLoader"); fCurrentVertex->SetName("Vertex"); // const char * name = fCurrentVertex->GetName(); // itsLoader->SetVerticesContName(name); - Int_t rc = itsLoader->PostVertex(fCurrentVertex); - rc = itsLoader->WriteVertices(); + itsLoader->PostVertex(fCurrentVertex); + itsLoader->WriteVertices(); } //______________________________________________________________________ void AliITSVertexer::FindVertices(){ // computes the vertices of the events in the range FirstEvent - LastEvent - AliRunLoader *rl = AliRunLoader::GetRunLoader(); + AliRunLoader *rl = AliRunLoader::Instance(); AliITSLoader* itsloader = (AliITSLoader*) rl->GetLoader("ITSLoader"); itsloader->LoadRecPoints("read"); for(Int_t i=fFirstEvent;i<=fLastEvent;i++){