From: kkanaki Date: Thu, 26 Nov 2009 21:32:50 +0000 (+0000) Subject: - added protection for slice and partition values out of range (referring to the... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=14b31e2b7e3c1009ea9cf7f83c2388a613f7bed4;p=u%2Fmrichter%2FAliRoot.git - added protection for slice and partition values out of range (referring to the ones calculated from the cluster indices) - cleanup of unnecessary variables --- diff --git a/HLT/TPCLib/AliHLTTPCTrackHistoComponent.cxx b/HLT/TPCLib/AliHLTTPCTrackHistoComponent.cxx index c7da0dee816..dbdfd0da613 100644 --- a/HLT/TPCLib/AliHLTTPCTrackHistoComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCTrackHistoComponent.cxx @@ -19,7 +19,7 @@ /** @file AliHLTTPCTrackHistoComponent.cxx @author Gaute Ovrebekk, Matthias Richter @date - @brief The TPC conformal mapping tracker component. + @brief A histogram component with track and associated cluster properties */ #if __GNUC__>= 3 @@ -50,18 +50,15 @@ ClassImp(AliHLTTPCTrackHistoComponent) AliHLTTPCTrackHistoComponent::AliHLTTPCTrackHistoComponent() : - fMinSlice(35) - , fMaxSlice(0) - , fMinPartition(5) - , fMaxPartition(0) //, fReset(0) - , fNEvents(0) + fNEvents(0) , fNtotTracks(0) , fEvtMod(20) , fBufferSize(5000) , fdEdx(kFALSE) , fMeanMultiplicity(NULL) , fMultiplicity(NULL) + //, fdNdEta(NULL) , fDeDxVsP(NULL) , fClusters(NULL) , fTracks(NULL) @@ -135,12 +132,11 @@ int AliHLTTPCTrackHistoComponent::DoInit( int argc, const char** argv ){ fClusters->SetCircular(5000); fTracks->SetCircular(5000); - //fTracksArray = new AliHLTTPCTrackArray(); - fMultiplicity = new TH1F("fMultiplicity", "Track multiplicity per event", 1000, 0, 1000); fMeanMultiplicity = new TH1F("fMeanMultiplicity", "Mean track multiplicity vs. #evt", 10000/fEvtMod, 0, 10000); fDeDxVsP = new TProfile("fDeDxVsP", "E deposition per unit length vs. p",100, 0, 100); fDeDxVsP->SetXTitle("p (GeV/c)"); + //fdNdEta = new TH1F("fdNdEta", "dN/d#eta",100,-10,10); // first configure the default int iResult=0; @@ -158,12 +154,12 @@ int AliHLTTPCTrackHistoComponent::DoDeinit(){ delete fClusters; delete fTracks; - //delete fTracksArray; - + delete fMultiplicity; delete fMeanMultiplicity; delete fDeDxVsP; - + //delete fdNdEta; + return 0; } @@ -187,8 +183,6 @@ int AliHLTTPCTrackHistoComponent::DoEvent(const AliHLTComponentEventData& /*evtD fNEvents++; - //if(!fTracksArray) fTracksArray = new AliHLTTPCTrackArray(); - const AliHLTComponentBlockData *iter = NULL; @@ -260,13 +254,7 @@ int AliHLTTPCTrackHistoComponent::DoEvent(const AliHLTComponentEventData& /*evtD void AliHLTTPCTrackHistoComponent::ReadTracks(const AliHLTComponentBlockData* iter,Int_t &tt){ // see header file for class documentation - AliHLTUInt8_t slice = AliHLTTPCDefinitions::GetMinSliceNr(*iter); - AliHLTUInt8_t partition = AliHLTTPCDefinitions::GetMinPatchNr(*iter); - - if( slice < fMinSlice ) fMinSlice = slice; - if( slice > fMaxSlice ) fMaxSlice = slice; - if( partition < fMinPartition ) fMinPartition = partition; - if( partition > fMaxPartition ) fMaxPartition = partition; + AliHLTUInt8_t slice = AliHLTTPCDefinitions::GetMinSliceNr(*iter); Int_t usedSpacePoints = 0; @@ -282,54 +270,63 @@ void AliHLTTPCTrackHistoComponent::ReadTracks(const AliHLTComponentBlockData* it UInt_t nHits = element->GetNumberOfPoints(); fTracks->Fill( 1./element->OneOverPt(), element->GetSnp(), element->GetTgl(), nHits ); + //fdNdEta->Fill(element->GetSnp()); - Double_t totCharge = 0; - const UInt_t *hitnum = element->GetPoints(); - for(UInt_t i=0; iGetNumberOfPoints(); i++){ - - UInt_t idTrack = hitnum[i]; - Int_t sliceTrack = (idTrack>>25) & 0x7f; - Int_t patchTrack = (idTrack>>22) & 0x7; - UInt_t pos = idTrack&0x3fffff; - - if( !fClustersArray[sliceTrack][patchTrack] ) continue; - if( fNSpacePoints[sliceTrack][patchTrack]GetResiduals(p,cov,kFALSE); - - //HLTInfo("resy: %f, resz: %f", res[0], res[1]); - - if(!res) res[0] = res[1] = -1000.; - else fClusters->Fill( (fClustersArray[sliceTrack][patchTrack])[pos].fCharge, (fClustersArray[sliceTrack][patchTrack])[pos].fQMax, res[0], res[1]); + Double_t totCharge = 0; + const UInt_t *hitnum = element->GetPoints(); + for(UInt_t i=0; iGetNumberOfPoints(); i++){ - usedSpacePoints++; - } + UInt_t idTrack = hitnum[i]; + Int_t sliceTrack = (idTrack>>25) & 0x7f; + Int_t patchTrack = (idTrack>>22) & 0x7; + UInt_t pos = idTrack&0x3fffff; + + if( !fClustersArray[sliceTrack][patchTrack] ) continue; + + if(sliceTrack<0 || sliceTrack>36 || patchTrack<0 || patchTrack>5 ){ + HLTError("Corrupted TPC cluster Id: slice %d, patch %d, cluster %d", sliceTrack, patchTrack, idTrack); + continue; + } + + if(fNSpacePoints[sliceTrack][patchTrack]<=pos ){ + HLTError("Space point array out of boundaries!"); + continue; + } + + totCharge += (fClustersArray[sliceTrack][patchTrack])[pos].fCharge; + + Float_t xyz[3]; xyz[0] = xyz[1] = xyz[2] = 0.; + + xyz[0] = (fClustersArray[sliceTrack][patchTrack])[pos].fX; + xyz[1] = (fClustersArray[sliceTrack][patchTrack])[pos].fY; + xyz[2] = (fClustersArray[sliceTrack][patchTrack])[pos].fZ; + + AliHLTTPCTransform::Local2Global(xyz,slice); + + Double_t p[2] = { xyz[1], xyz[2] }; + Double_t cov[3] = { (fClustersArray[sliceTrack][patchTrack])[pos].fSigmaY2, 0., (fClustersArray[sliceTrack][patchTrack])[pos].fSigmaZ2}; + Double_t *res = element->GetResiduals(p,cov,kFALSE); + + //HLTInfo("resy: %f, resz: %f", res[0], res[1]); + + if(!res) res[0] = res[1] = -1000.; + else fClusters->Fill( (fClustersArray[sliceTrack][patchTrack])[pos].fCharge, (fClustersArray[sliceTrack][patchTrack])[pos].fQMax, res[0], res[1]); + + usedSpacePoints++; + } if(fdEdx==kTRUE && trackLength > 0) fDeDxVsP->Fill(element->OneOverPt()*TMath::Sqrt(1.+element->GetTgl()*element->GetTgl()), totCharge/trackLength); } } void AliHLTTPCTrackHistoComponent::PushHisto(){ // see header file for class documentation - - AliHLTUInt32_t fSpecification = AliHLTTPCDefinitions::EncodeDataSpecification(fMinSlice,fMaxSlice,fMinPartition,fMaxPartition); - PushBack( (TObject*)fTracks, kAliHLTDataTypeTNtuple |kAliHLTDataOriginTPC, fSpecification); - PushBack( (TObject*)fClusters, kAliHLTDataTypeTNtuple |kAliHLTDataOriginTPC, fSpecification); - PushBack( (TObject*)fMultiplicity, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, fSpecification); - PushBack( (TObject*)fMeanMultiplicity, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, fSpecification); - PushBack( (TObject*)fDeDxVsP, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, fSpecification); + PushBack( (TObject*)fTracks, kAliHLTDataTypeTNtuple |kAliHLTDataOriginTPC, 0x0); + PushBack( (TObject*)fClusters, kAliHLTDataTypeTNtuple |kAliHLTDataOriginTPC, 0x0); + PushBack( (TObject*)fMultiplicity, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, 0x0); + PushBack( (TObject*)fMeanMultiplicity, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, 0x0); + PushBack( (TObject*)fDeDxVsP, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, 0x0); + //PushBack( (TObject*)fdNdEta, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, 0x0); } int AliHLTTPCTrackHistoComponent::ScanConfigurationArgument(int argc, const char** argv){ diff --git a/HLT/TPCLib/AliHLTTPCTrackHistoComponent.h b/HLT/TPCLib/AliHLTTPCTrackHistoComponent.h index c8b215cb84b..88e9f6bfd47 100644 --- a/HLT/TPCLib/AliHLTTPCTrackHistoComponent.h +++ b/HLT/TPCLib/AliHLTTPCTrackHistoComponent.h @@ -23,15 +23,14 @@ class TProfile; /** * @class AliHLTTPCTrackHistoComponent - * Component for ploting proparties of Tracks. - * The component gives out two NTuples. One for cluster- and one for track proprties + * Component for plotting proparties of Tracks. + * The component gives out 2 NTuples. One for cluster and one for track properties * *

General properties:

* * Component ID: \b TPCTrackHisto
* Library: \b libAliHLTTPC.so
* Input Data Types: AliHLTTPCDefinitions::fgkClustersDataType, - * AliHLTTPCDefinitions::fgkTrackSegmentsDataType or * AliHLTTPCDefinitions::fgkTracksDataType
* Output Data Types: ::kAliHLTDataTypeTNtuple
* @@ -115,11 +114,6 @@ private: void PushHisto(); - AliHLTUInt8_t fMinSlice; //! transient - AliHLTUInt8_t fMaxSlice; //! transient - AliHLTUInt8_t fMinPartition; //! transient - AliHLTUInt8_t fMaxPartition; //! transient - Int_t fNEvents; //! transient Int_t fNtotTracks; //! transient @@ -130,6 +124,7 @@ private: TH1F *fMeanMultiplicity; //! transient (mean multiplicity for every 20 evts vs. #evt by Z.Y.) TH1F *fMultiplicity; //! transient (track multiplicity by Z.Y.) + //TH1F *fdNdEta; //! transient (dN/dEta) //TH2F *fNClusterVsXY; //! transient (#Clusters vs. x, y positions, by ZY) //TH2F *fChargeVsXY; //! transient (Charge distr. vs. x, y added by ZY) @@ -146,7 +141,7 @@ private: /** the default configuration entry for this component */ static const char* fgkOCDBEntry; //!transient - ClassDef(AliHLTTPCTrackHistoComponent, 4); + ClassDef(AliHLTTPCTrackHistoComponent, 5); }; #endif