X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSVertexer.cxx;h=05e8f6ccf99c942dee6cdda8f28b3347a571fdae;hb=77bbf113a85d8cf07857ee1ad2c0cb455f8bb7ae;hp=250b9cca5b18cdad8533bf2468c15f47ac6a832d;hpb=308c2f7c71668bd4c7193564d1da2ebd974ea86c;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSVertexer.cxx b/ITS/AliITSVertexer.cxx index 250b9cca5b1..05e8f6ccf99 100644 --- a/ITS/AliITSVertexer.cxx +++ b/ITS/AliITSVertexer.cxx @@ -16,15 +16,24 @@ ClassImp(AliITSVertexer) // AliITSVertexerCosmics // ////////////////////////////////////////////////////////////////////// +/* $Id$ */ + //______________________________________________________________________ AliITSVertexer::AliITSVertexer():AliVertexer(), fLadders(), fLadOnLay2(0), +fDetTypeRec(NULL), +fMinTrackletsForPilup(0), +fIsPileup(0), +fNTrpuv(-2), +fZpuv(-9999999.), fFirstEvent(0), fLastEvent(-1) { // Default Constructor SetLaddersOnLayer2(); + SetMinTrackletsForPilup(); + for(Int_t i=0; iGetNContributors()<1)success=kFALSE; + + // get the FastOr bit mask + TBits fastOrFiredMap = fDetTypeRec->GetFastOrFiredMap(); + + 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 (!itsClusterTree) { + AliError(" Invalid ITS cluster tree !\n"); + return; + } + 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,fastOrFiredMap); return; } - AliITSMultReconstructor* multReco = new AliITSMultReconstructor(); if (!itsClusterTree) { AliError(" Invalid ITS cluster tree !\n"); @@ -55,29 +78,32 @@ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){ fCurrentVertex->GetXYZ(vtx); Float_t vtxf[3]; for(Int_t i=0;i<3;i++)vtxf[i]=vtx[i]; - multReco->SetHistOn(kFALSE); - multReco->Reconstruct(itsClusterTree,vtxf,vtxf); - Int_t notracks=multReco->GetNTracklets(); + multReco.SetHistOn(kFALSE); + multReco.Reconstruct(itsClusterTree,vtxf,vtxf); + Int_t notracks=multReco.GetNTracklets(); Float_t *tht = new Float_t [notracks]; Float_t *phi = 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;iGetNTracklets();i++){ - tht[i] = multReco->GetTracklet(i)[0]; - phi[i] = multReco->GetTracklet(i)[1]; - dphi[i] = multReco->GetTracklet(i)[2]; - labels[i] = static_cast(multReco->GetTracklet(i)[3]); - labelsL2[i] = static_cast(multReco->GetTracklet(i)[4]); + for(Int_t i=0;i(multReco.GetTracklet(i)[3]); + labelsL2[i] = static_cast(multReco.GetTracklet(i)[4]); } - Int_t nosingleclus=multReco->GetNSingleClusters(); + Int_t nosingleclus=multReco.GetNSingleClusters(); Float_t *ths = new Float_t [nosingleclus]; Float_t *phs = new Float_t [nosingleclus]; for(Int_t i=0;iGetCluster(i)[0]; - phs[i] = multReco->GetCluster(i)[1]; + ths[i] = multReco.GetCluster(i)[0]; + phs[i] = multReco.GetCluster(i)[1]; } - fMult = new AliMultiplicity(notracks,tht,phi,dphi,labels,labelsL2,nosingleclus,ths,phs); + Short_t nfcL1 = multReco.GetNFiredChips(0); + Short_t nfcL2 = multReco.GetNFiredChips(1); + fMult = new AliMultiplicity(notracks,tht,phi,dphi,labels,labelsL2,nosingleclus,ths,phs,nfcL1,nfcL2,fastOrFiredMap); + delete [] tht; delete [] phi; delete [] dphi; @@ -86,7 +112,6 @@ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){ delete [] labels; delete [] labelsL2; - delete multReco; return; } @@ -135,7 +160,7 @@ void AliITSVertexer::SetLaddersOnLayer2(Int_t ladwid){ 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"); } @@ -149,7 +174,7 @@ 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(); @@ -162,7 +187,7 @@ void AliITSVertexer::WriteCurrentVertex(){ 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++){