From: nick Date: Mon, 31 Oct 2005 09:06:06 +0000 (+0000) Subject: 27-oct-2005 NvE Memberfunction GetX to access individual vector components also intro... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=e51b7d1a0995905e4c774fca418f2aa166e22907;p=u%2Fmrichter%2FAliRoot.git 27-oct-2005 NvE Memberfunction GetX to access individual vector components also introduced for Ali4Vector. Also memberfunction SortJets introduced in AliVertex. Misleading comment modified in AliDevice.cxx. 29-oct-2005 NvE Forgotten angular unit setting fixed w.r.t. begin point etc... in AliTrack::ListAll ad begin point etc... info also added in AliTrack::List. Memberfunction SortTracks introduced in AliJet and comment corrected in AliVertex.h. 31-oct-2005 NvE Slight correction in IceCalibrate.cxx and IceCleanhits.cxx to satisfy the gcc compiler (thanks Dipo). 31-oct-2005 NvE Some unused variables removed in IceCal2Root and IceF2k to prevent warnings from the gcc compiler. --- diff --git a/RALICE/AliJet.cxx b/RALICE/AliJet.cxx index b6af9401f69..c2141b43e88 100644 --- a/RALICE/AliJet.cxx +++ b/RALICE/AliJet.cxx @@ -774,6 +774,148 @@ Int_t AliJet::GetId() const return fUserId; } /////////////////////////////////////////////////////////////////////////// +TObjArray* AliJet::SortTracks(Int_t mode,TObjArray* tracks) +{ +// Order the references to an array of tracks by looping over the input array "tracks" +// and checking the value of a certain observable. +// The ordered array is returned as a TObjArray. +// In case tracks=0 (default), the registered tracks of the current jet are used. +// Note that the original track array is not modified. +// Via the "mode" argument the user can specify the observable to be checked upon +// and specify whether sorting should be performed in decreasing order (mode<0) +// or in increasing order (mode>0). +// +// The convention for the observable selection is the following : +// mode : 1 ==> Number of signals associated to the track +// 2 ==> Track energy +// 3 ==> Track momentum +// 4 ==> Mass of the track +// 5 ==> Transverse momentum of the track +// 6 ==> Longitudinal momentum of the track +// 7 ==> Transverse energy of the track +// 8 ==> Longitudinal energy of the track +// 9 ==> Transverse mass of the track +// 10 ==> Track rapidity +// 11 ==> Pseudo-rapidity of the track +// +// The default is mode=-1. +// +// Note : This sorting routine uses a common area in memory, which is used +// by various other sorting facilities as well. +// This means that the resulting sorted TObjArray may be overwritten +// when another sorting is invoked. +// To retain the sorted list of pointers, the user is advised to copy +// the pointers contained in the returned TObjArray into a private +// TObjArray instance. + + if (fSelected) + { + delete fSelected; + fSelected=0; + } + + if (!tracks) tracks=fTracks; + + if (abs(mode)>11 || !tracks) return fSelected; + + Int_t ntracks=tracks->GetEntries(); + if (!ntracks) + { + return fSelected; + } + else + { + fSelected=new TObjArray(ntracks); + } + + Double_t val1,val2; // Values of the observable to be tested upon + + Int_t nord=0; + for (Int_t i=0; iAt(i); + + if (!tx) continue; + + if (nord == 0) // store the first track at the first ordered position + { + nord++; + fSelected->AddAt(tx,nord-1); + continue; + } + + for (Int_t j=0; j<=nord; j++) // put track in the right ordered position + { + if (j == nord) // track has smallest (mode<0) or largest (mode>0) observable value seen so far + { + nord++; + fSelected->AddAt(tx,j); // add track at the end + break; // go for next track + } + + switch (abs(mode)) + { + case 1: + val1=tx->GetNsignals(); + val2=((AliTrack*)fSelected->At(j))->GetNsignals(); + break; + case 2: + val1=tx->GetEnergy(); + val2=((AliTrack*)fSelected->At(j))->GetEnergy(); + break; + case 3: + val1=tx->GetMomentum(); + val2=((AliTrack*)fSelected->At(j))->GetMomentum(); + break; + case 4: + val1=tx->GetMass(); + val2=((AliTrack*)fSelected->At(j))->GetMass(); + break; + case 5: + val1=tx->GetPt(); + val2=((AliTrack*)fSelected->At(j))->GetPt(); + break; + case 6: + val1=tx->GetPl(); + val2=((AliTrack*)fSelected->At(j))->GetPl(); + break; + case 7: + val1=tx->GetEt(); + val2=((AliTrack*)fSelected->At(j))->GetEt(); + break; + case 8: + val1=tx->GetEl(); + val2=((AliTrack*)fSelected->At(j))->GetEl(); + break; + case 9: + val1=tx->GetMt(); + val2=((AliTrack*)fSelected->At(j))->GetMt(); + break; + case 10: + val1=tx->GetRapidity(); + val2=((AliTrack*)fSelected->At(j))->GetRapidity(); + break; + case 11: + val1=tx->GetPseudoRapidity(); + val2=((AliTrack*)fSelected->At(j))->GetPseudoRapidity(); + break; + } + + if (mode<0 && val1 < val2) continue; + if (mode>0 && val1 > val2) continue; + + nord++; + for (Int_t k=nord-1; k>j; k--) // create empty position + { + fSelected->AddAt(fSelected->At(k-1),k); + } + fSelected->AddAt(tx,j); // put track at empty position + break; // go for next track + } + } + return fSelected; +} +/////////////////////////////////////////////////////////////////////////// TObject* AliJet::Clone(const char* name) const { // Make a deep copy of the current object and provide the pointer to the copy. diff --git a/RALICE/AliJet.h b/RALICE/AliJet.h index 4c4d80d57fb..dd8df588442 100644 --- a/RALICE/AliJet.h +++ b/RALICE/AliJet.h @@ -48,6 +48,7 @@ class AliJet : public TNamed,public Ali4Vector Int_t GetTrackCopy() const; // Provide TrackCopy flag value void SetId(Int_t id); // Set the user defined identifier Int_t GetId() const; // Provide the user defined identifier + TObjArray* SortTracks(Int_t mode=-1,TObjArray* tracks=0); // Sort tracks by a certain observable protected: void Init(); // Initialisation of pointers etc... @@ -63,6 +64,6 @@ class AliJet : public TNamed,public Ali4Vector Int_t fUserId; // The user defined identifier TObjArray* fSelected; //! Temp. array to hold user selected or ordered objects - ClassDef(AliJet,12) // Creation and investigation of a jet of particle tracks. + ClassDef(AliJet,13) // Creation and investigation of a jet of particle tracks. }; #endif diff --git a/RALICE/AliTrack.cxx b/RALICE/AliTrack.cxx index 672059497a0..1a50f24cf1b 100644 --- a/RALICE/AliTrack.cxx +++ b/RALICE/AliTrack.cxx @@ -419,6 +419,9 @@ void AliTrack::List(TString f,TString u) // The defaults are f="car" and u="rad". Data(f,u); // Information of the current track + if (fBegin) { cout << " Begin-point :"; fBegin->Data(f,u); } + if (fEnd) { cout << " End-point :"; fEnd->Data(f,u); } + if (fRef) { cout << " Ref-point :"; fRef->Data(f,u); } // Decay products of this track AliTrack* td; @@ -449,9 +452,9 @@ void AliTrack::ListAll(TString f,TString u) // The defaults are f="car" and u="rad". Data(f,u); // Information of the current track - if (fBegin) { cout << " Begin-point :"; fBegin->Data(f); } - if (fEnd) { cout << " End-point :"; fEnd->Data(f); } - if (fRef) { cout << " Ref-point :"; fRef->Data(f); } + if (fBegin) { cout << " Begin-point :"; fBegin->Data(f,u); } + if (fEnd) { cout << " End-point :"; fEnd->Data(f,u); } + if (fRef) { cout << " Ref-point :"; fRef->Data(f,u); } Int_t nhyp=GetNhypotheses(); if (nhyp) diff --git a/RALICE/AliVertex.h b/RALICE/AliVertex.h index 4fa334506ae..12ff83a6c7c 100644 --- a/RALICE/AliVertex.h +++ b/RALICE/AliVertex.h @@ -48,7 +48,7 @@ class AliVertex : public AliJet,public AliPosition Int_t IsJetTrack(AliTrack* t) const; // Indicate if track is resulting from jet addition virtual void Draw(Option_t*) { Draw(1,1,0); } // Override TObject::Draw for default event display virtual void Draw(Int_t secs,Int_t cons=1,Int_t jets=0); // Draw the vertex in an event display - TObjArray* SortJets(Int_t mode=-1,TObjArray* jets=0); // Sort jets by the number of tracks + TObjArray* SortJets(Int_t mode=-1,TObjArray* jets=0); // Sort jets by a certain observable protected: void Init(); // Initialisation of pointers etc... diff --git a/RALICE/history.txt b/RALICE/history.txt index aed03f43c36..687be54b7bc 100644 --- a/RALICE/history.txt +++ b/RALICE/history.txt @@ -658,3 +658,6 @@ for Ali4Vector. Also memberfunction SortJets introduced in AliVertex. Misleading comment modified in AliDevice.cxx. +29-oct-2005 NvE Forgotten angular unit setting fixed w.r.t. begin point etc... in AliTrack::ListAll + ad begin point etc... info also added in AliTrack::List. + Memberfunction SortTracks introduced in AliJet and comment corrected in AliVertex.h. diff --git a/RALICE/icepack/IceCalibrate.cxx b/RALICE/icepack/IceCalibrate.cxx index 0dc3bbab73f..66ae6bdbdb6 100644 --- a/RALICE/icepack/IceCalibrate.cxx +++ b/RALICE/icepack/IceCalibrate.cxx @@ -121,7 +121,7 @@ void IceCalibrate::Exec(Option_t* opt) // Set global OM constants if (omd) { - ome->SetPosition((Ali3Vector)omd->GetPosition()); + ome->SetPosition((Ali3Vector&)omd->GetPosition()); for (Int_t isd=4; isd<17; isd++) { ome->SetSignal(omd->GetSignal(isd),isd); diff --git a/RALICE/icepack/IceCleanHits.cxx b/RALICE/icepack/IceCleanHits.cxx index db9c5940976..d6d7fbe89ce 100644 --- a/RALICE/icepack/IceCleanHits.cxx +++ b/RALICE/icepack/IceCleanHits.cxx @@ -152,7 +152,7 @@ void IceCleanHits::Amanda() // It seems that in 2005 the trigger time was changed within the year // from 24170 ns to 12138 ns. The latter however shows a 2-bump structure, // so currently the 24170 ns will be used for the 2005 data. - Int_t year=fEvt->GetJE(); + Int_t year=(int)fEvt->GetJE(); Float_t ttrig=23958; if (year==2003) ttrig=23994; if (year==2004) ttrig=24059.5; diff --git a/RALICE/icepack/history.txt b/RALICE/icepack/history.txt index 683bf4405b6..950519b6e87 100644 --- a/RALICE/icepack/history.txt +++ b/RALICE/icepack/history.txt @@ -18,4 +18,6 @@ 20-oct-2005 NvE Trigger time window selection introduced in IceCleanHits based on Dipo's trigger time distributions. For further details see the docs of IceCleanHits. +31-oct-2005 NvE Slight correction in IceCalibrate.cxx and IceCleanhits.cxx to satisfy + the gcc compiler (thanks Dipo). diff --git a/RALICE/icepack/iceconvert/IceCal2Root.cxx b/RALICE/icepack/iceconvert/IceCal2Root.cxx index 13ea8b93393..efc1fafe0c6 100644 --- a/RALICE/icepack/iceconvert/IceCal2Root.cxx +++ b/RALICE/icepack/iceconvert/IceCal2Root.cxx @@ -371,7 +371,7 @@ void IceCal2Root::GetCalibData() Float_t thresh=0; Float_t sensit=1; Double_t pos[3]={0,0,0}; - Float_t ped,beta,alpha,kappa; + Float_t ped,beta,alpha; Int_t pol; Float_t totped; Int_t jtrans,jrec; diff --git a/RALICE/icepack/iceconvert/IceF2k.cxx b/RALICE/icepack/iceconvert/IceF2k.cxx index c2a86b6ebc8..eb15296bb2a 100644 --- a/RALICE/icepack/iceconvert/IceF2k.cxx +++ b/RALICE/icepack/iceconvert/IceF2k.cxx @@ -351,11 +351,9 @@ void IceF2k::FillOMdbase() if (fHeader.nch<=0) return; - Int_t geocal=fHeader.is_calib.geo; Int_t adccal=fHeader.is_calib.adc; Int_t tdccal=fHeader.is_calib.tdc; Int_t totcal=fHeader.is_calib.tot; - Int_t utccal=fHeader.is_calib.utc; TF1 fadccal("fadccal","(x-[1])*[0]"); TF1 fadcdecal("fadcdecal","(x/[0])+[1]"); diff --git a/RALICE/icepack/iceconvert/history.txt b/RALICE/icepack/iceconvert/history.txt index e0a68bb9d83..dcd16213044 100644 --- a/RALICE/icepack/iceconvert/history.txt +++ b/RALICE/icepack/iceconvert/history.txt @@ -33,4 +33,6 @@ for adc<=0 values. This setting eliminates the ADC dependent TDC correction. 12-oct-2005 NvE CleanTasks() invoked before execution of sub-tasks in IceConvert and IceCal2Root to ensure proper execution of all the sub-tasks for each new event. +31-oct-2005 NvE Some unused variables removed in IceCal2Root and IceF2k to prevent warnings + from the gcc compiler.