From 3136129d02d6192be3de72d5f069063d8bb10061 Mon Sep 17 00:00:00 2001 From: cvetan Date: Mon, 29 Nov 2004 09:46:14 +0000 Subject: [PATCH] Introduction of ITS clustrerer for HLT. Improved version of the fast ITS vertexer and some bugfixes. Minor change in the HLT ITS tracker in order to store to the ESD the tracks params at the vertex. --- HLT/ITS/AliL3ITSLinkDef.h | 1 + HLT/ITS/AliL3ITSVertexerZ.cxx | 105 +++++++++++++++++++--------------- HLT/ITS/AliL3ITSVertexerZ.h | 5 +- HLT/ITS/AliL3ITSclusterer.cxx | 83 +++++++++++++++++++++++++++ HLT/ITS/AliL3ITSclusterer.h | 35 ++++++++++++ HLT/ITS/AliL3ITStracker.cxx | 7 ++- HLT/libAliL3ITS.pkg | 2 +- 7 files changed, 188 insertions(+), 50 deletions(-) create mode 100644 HLT/ITS/AliL3ITSclusterer.cxx create mode 100644 HLT/ITS/AliL3ITSclusterer.h diff --git a/HLT/ITS/AliL3ITSLinkDef.h b/HLT/ITS/AliL3ITSLinkDef.h index 92401001b24..ed3665e9117 100644 --- a/HLT/ITS/AliL3ITSLinkDef.h +++ b/HLT/ITS/AliL3ITSLinkDef.h @@ -9,6 +9,7 @@ #pragma link C++ class AliL3ITStrack; #pragma link C++ class AliL3ITStracker; #pragma link C++ class AliL3ITSVertexerZ; +#pragma link C++ class AliL3ITSclusterer; #endif #endif diff --git a/HLT/ITS/AliL3ITSVertexerZ.cxx b/HLT/ITS/AliL3ITSVertexerZ.cxx index 02b3a424525..90abaa763ed 100644 --- a/HLT/ITS/AliL3ITSVertexerZ.cxx +++ b/HLT/ITS/AliL3ITSVertexerZ.cxx @@ -21,6 +21,7 @@ #include "AliITSLoader.h" #include #include +#include //------------------------------------------------------------------------- // Implementation of the HLT ITS vertexer class @@ -30,6 +31,27 @@ ClassImp(AliL3ITSVertexerZ) +AliL3ITSVertexerZ::AliL3ITSVertexerZ():AliITSVertexerZ(){ + // Constructor in case that there is no runloader + + SetDiffPhiMax(); + fX0 = 0; + fY0 = 0; + SetFirstLayerModules(); + SetSecondLayerModules(); + fZFound = 0; + fZsig = 0.; + fITS = 0; + fZCombc = 0; + fZCombf = 0; + SetLowLimit(); + SetHighLimit(); + SetBinWidthCoarse(); + SetBinWidthFine(); + SetTolerance(); + SetDebug(); +} + AliL3ITSVertexerZ::AliL3ITSVertexerZ(TString filename,Float_t x0, Float_t y0):AliITSVertexerZ(filename,x0,y0) { // Standard Constructor @@ -58,46 +80,38 @@ AliESDVertex* AliL3ITSVertexerZ::FindVertexForCurrentEvent(Int_t evnumber){ AliITSgeom *geom = fITS->GetITSgeom(); TTree *tR = itsLoader->TreeR(); - TClonesArray *itsRec = 0; + + return FindVertexForCurrentEvent(geom,tR); +} + +//______________________________________________________________________ +AliESDVertex* AliL3ITSVertexerZ::FindVertexForCurrentEvent(AliITSgeom *geom,TTree *tR){ + // Defines the AliESDVertex for the current event + + fCurrentVertex = 0; + Float_t lc[3]; for(Int_t ii=0; ii<3; ii++) lc[ii]=0.; Float_t gc[3]; for(Int_t ii=0; ii<3; ii++) gc[ii]=0.; Float_t lc2[3]; for(Int_t ii=0; ii<3; ii++) lc2[ii]=0.; Float_t gc2[3]; for(Int_t ii=0; ii<3; ii++) gc2[ii]=0.; - itsRec = fITS->RecPoints(); - - //cout<<"Address of itsRec = "<GetBranch("Clusters"); - branch->SetAddress(&clusters); - } - else { - branch = tR->GetBranch("ITSRecPoints"); - } - + branch = tR->GetBranch("Clusters"); + branch->SetAddress(&clusters); Int_t nrpL1 = 0; Int_t nrpL2 = 0; for(Int_t module= fFirstL1; module<=fLastL1;module++){ if(module%4==0 || module%4==3)continue; // cout<<"Procesing module "<GetEvent(module); + tR->GetEvent(module); // cout<<"Number of clusters "<GetEntries()<GetEntries(); - fITS->ResetRecPoints(); + nrpL1+= clusters->GetEntriesFast(); } for(Int_t module= fFirstL2; module<=fLastL2;module++){ - branch->GetEvent(module); - if(fUseV2Clusters){ - Clusters2RecPoints(clusters,module,itsRec); - } - nrpL2+= itsRec->GetEntries(); - fITS->ResetRecPoints(); + tR->GetEvent(module); + nrpL2+= clusters->GetEntriesFast(); } if(nrpL1 == 0 || nrpL2 == 0){ ResetHistograms(); @@ -125,19 +139,20 @@ AliESDVertex* AliL3ITSVertexerZ::FindVertexForCurrentEvent(Int_t evnumber){ phi2[i] = new Float_t [maxind2]; r2[i] = new Float_t [maxind2]; } + + Float_t yshift = 0; + Float_t zshift[4] = {-10.708000, -3.536000, 3.536000, 10.708000}; + yshift = 0.248499; memset(ind1,0,nPhiBins*sizeof(Int_t)); for(Int_t module= fFirstL1; module<=fLastL1;module++){ if(module%4==0 || module%4==3)continue; - branch->GetEvent(module); - if(fUseV2Clusters){ - Clusters2RecPoints(clusters,module,itsRec); - } - Int_t nrecp1 = itsRec->GetEntries(); + tR->GetEvent(module); + Int_t nrecp1 = clusters->GetEntriesFast(); for(Int_t j=0;jAt(j); - lc[0]=recp->GetX(); - lc[2]=recp->GetZ(); + AliITSclusterV2 *recp = (AliITSclusterV2*)clusters->UncheckedAt(j); + lc[0]=-recp->GetY()+yshift; + lc[2]=-recp->GetZ()+zshift[module%4]; geom->LtoG(module,lc,gc); gc[0]-=fX0; gc[1]-=fY0; @@ -147,6 +162,7 @@ AliESDVertex* AliL3ITSVertexerZ::FindVertexForCurrentEvent(Int_t evnumber){ Float_t phi = TMath::ATan2(gc[1],gc[0]); if(phi<0)phi=2*TMath::Pi()+phi; Int_t bin = (Int_t)(phi/phiBinSize); + if(bin>=nPhiBins || bin<0) bin = 0; Int_t ind = ind1[bin]; if(indResetRecPoints(); + clusters->Delete(); } + yshift = 3.096207; memset(ind2,0,nPhiBins*sizeof(Int_t)); for(Int_t module= fFirstL2; module<=fLastL2;module++){ - branch->GetEvent(module); - if(fUseV2Clusters){ - Clusters2RecPoints(clusters,module,itsRec); - } - Int_t nrecp2 = itsRec->GetEntries(); + tR->GetEvent(module); + Int_t nrecp2 = clusters->GetEntriesFast(); for(Int_t j=0;jAt(j); - lc[0]=recp->GetX(); - lc[2]=recp->GetZ(); + AliITSclusterV2 *recp = (AliITSclusterV2*)clusters->UncheckedAt(j); + lc[0]=recp->GetY()+yshift; + lc[2]=-recp->GetZ()+zshift[module%4]; geom->LtoG(module,lc,gc); gc[0]-=fX0; gc[1]-=fY0; @@ -177,7 +191,7 @@ AliESDVertex* AliL3ITSVertexerZ::FindVertexForCurrentEvent(Int_t evnumber){ Float_t phi = TMath::ATan2(gc[1],gc[0]); if(phi<0)phi=2*TMath::Pi()+phi; Int_t bin = (Int_t)(phi/phiBinSize+0.5); - if(bin==nPhiBins) bin = 0; + if(bin>=nPhiBins || bin<0) bin = 0; Int_t ind = ind2[bin]; if(indResetRecPoints(); + clusters->Delete(); } Int_t nbinfine = static_cast((fHighLim-fLowLim)/fStepFine); Float_t lowz = fLowLim/fStepFine; - Float_t highz = fHighLim/fStepFine; Int_t *harray = new Int_t[nbinfine]; memset(harray,0,nbinfine*sizeof(Int_t)); for(Int_t ibin=0;ibinTMath::Pi())diff=2.*TMath::Pi()-diff; if(difflowz && zr0=0 && bin +#include + +ClassImp(AliL3ITSclusterer) + +AliL3ITSclusterer::AliL3ITSclusterer(const AliITSgeom *geom):AliITSclustererV2(geom) +{ +fNModule = geom->GetIndexMax(); +} + +void AliL3ITSclusterer::Digits2Clusters(AliRawReader* rawReader,TTree *cTree) +{ + + TClonesArray *array=new TClonesArray("AliITSclusterV2",1000); + cTree->Branch("Clusters",&array); + delete array; + + TClonesArray** clusters = new TClonesArray*[fNModule]; + for (Int_t iModule = 0; iModule < fNModule; iModule++) { + clusters[iModule] = NULL; + } + + rawReader->Reset(); + AliITSRawStreamSPD inputSPD(rawReader); + FindClustersSPD(&inputSPD, clusters); + + rawReader->Reset(); + AliITSRawStreamSDD inputSDD(rawReader); + FindClustersSDD(&inputSDD, clusters); + + rawReader->Reset(); + AliITSRawStreamSSD inputSSD(rawReader); + FindClustersSSD(&inputSSD, clusters); + + // write all clusters to the tree + Int_t nClusters = 0; + for (Int_t iModule = 0; iModule < fNModule; iModule++) { + array = clusters[iModule]; + if (!array) { + Error("Digits2Clusters", "data for module %d missing!", iModule); + array = new TClonesArray("AliITSclusterV2"); + } + cTree->SetBranchAddress("Clusters", &array); + cTree->Fill(); + nClusters += array->GetEntriesFast(); + delete array; + } + + delete[] clusters; + + Info("Digits2Clusters", "total number of found clusters in ITS: %d\n", + nClusters); +} diff --git a/HLT/ITS/AliL3ITSclusterer.h b/HLT/ITS/AliL3ITSclusterer.h new file mode 100644 index 00000000000..254a4c8e4fc --- /dev/null +++ b/HLT/ITS/AliL3ITSclusterer.h @@ -0,0 +1,35 @@ +#ifndef ALIL3ITSCLUSTERER_H +#define ALIL3ITSCLUSTERER_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +//------------------------------------------------------------------------- +// High Level Trigger ITS clusterer +// This class derives completely from the off-line AliITSclustererV2. +// The only difference is in the interface of calling it and stoting +// the clusters's tree. +// +// Origin: Cvetan Cheshkov, CERN, Cvetan.Cheshkov@cern.ch +//------------------------------------------------------------------------- + +#include "AliITSclustererV2.h" + +class TTree; +class AliITSgeom; +class AliRawReader; + +//------------------------------------------------------------------------- +class AliL3ITSclusterer : public AliITSclustererV2 { +public: + AliL3ITSclusterer():AliITSclustererV2(){fNModule = 0;} + AliL3ITSclusterer(const AliITSgeom *geom); + + void Digits2Clusters(AliRawReader* rawReader,TTree *cTree); + +private: + Int_t fNModule; // total number of modules + + ClassDef(AliL3ITSclusterer,1) //HLT ITS clusterer +}; + +#endif diff --git a/HLT/ITS/AliL3ITStracker.cxx b/HLT/ITS/AliL3ITStracker.cxx index f9a63853863..0ded8444f12 100644 --- a/HLT/ITS/AliL3ITStracker.cxx +++ b/HLT/ITS/AliL3ITStracker.cxx @@ -106,10 +106,11 @@ Int_t AliL3ITStracker::Clusters2Tracks(AliESD *event) { for (fPass=0; fPass<2; fPass++) { Int_t &constraint=fConstraint[fPass]; if (constraint<0) continue; for (Int_t i=0; iGetLabel(); //save the TPC track label - + // Info("Clusters2Tracks","Pt:%f",1/t->Get1Pt()); ResetTrackToFollow(*t); ResetBestTrack(); @@ -123,8 +124,10 @@ Int_t AliL3ITStracker::Clusters2Tracks(AliESD *event) { ResetTrackToFollow(*t); if (!RefitAt(3.7, &fTrackToFollow, &fBestTrack)) continue; ResetBestTrack(); - } + } + if (!fBestTrack.PropagateTo(3.,0.0028,65.19)) continue; + if (!fBestTrack.PropagateToVertex()) continue; fBestTrack.SetLabel(tpcLabel); fBestTrack.CookdEdx(); CookLabel(&fBestTrack,0.); //For comparison only diff --git a/HLT/libAliL3ITS.pkg b/HLT/libAliL3ITS.pkg index f0cfe9e8691..4259abf28da 100644 --- a/HLT/libAliL3ITS.pkg +++ b/HLT/libAliL3ITS.pkg @@ -2,7 +2,7 @@ include HLT/hlt.conf -SRCS:= ITS/AliL3ITStrack.cxx ITS/AliL3ITStracker.cxx ITS/AliL3ITSVertexerZ.cxx +SRCS:= ITS/AliL3ITStrack.cxx ITS/AliL3ITStracker.cxx ITS/AliL3ITSVertexerZ.cxx ITS/AliL3ITSclusterer.cxx HDRS:= $(SRCS:.cxx=.h) $(HLTEHDRS) -- 2.31.1