]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
27-oct-2005 NvE Memberfunction GetX to access individual vector components also intro...
authornick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Oct 2005 09:06:06 +0000 (09:06 +0000)
committernick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Oct 2005 09:06:06 +0000 (09:06 +0000)
                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.

RALICE/AliJet.cxx
RALICE/AliJet.h
RALICE/AliTrack.cxx
RALICE/AliVertex.h
RALICE/history.txt
RALICE/icepack/IceCalibrate.cxx
RALICE/icepack/IceCleanHits.cxx
RALICE/icepack/history.txt
RALICE/icepack/iceconvert/IceCal2Root.cxx
RALICE/icepack/iceconvert/IceF2k.cxx
RALICE/icepack/iceconvert/history.txt

index b6af9401f69cf1373461e50641bb4b8f054e700e..c2141b43e885f9a21515c8b10277448daa0bd2e4 100644 (file)
@@ -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; i<ntracks; i++) // Loop over all tracks of the array
+ {
+  AliTrack* tx=(AliTrack*)tracks->At(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.
index 4c4d80d57fb0e6c0a424f286acf3f11e2d80fd90..dd8df588442904926c548cb46b3c2b505ac7aede 100644 (file)
@@ -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
index 672059497a026036d0b54edbeb7956c1ba3a6152..1a50f24cf1ba2b8ca53a7c4b1608017da5591ae6 100644 (file)
@@ -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)
index 4fa334506ae3a27320a774e55de9f9222c0c25f1..12ff83a6c7c86030576f8d71766c389d576a64cb 100644 (file)
@@ -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... 
index aed03f43c3652fc43a51102217e6fdbed9e75987..687be54b7bc75c480263c649fea6930e359e792f 100644 (file)
                 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.
index 0dc3bbab73f4aea973c0a63e7bb2eb03ff591002..66ae6bdbdb60c44c8236199f18e9aa5529d1ba1e 100644 (file)
@@ -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);
index db9c5940976ff452da811f3643360cf09be9b0f1..d6d7fbe89ce96219ae852aaec70491f1e3a2fb5a 100644 (file)
@@ -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;
index 683bf4405b62d4874cb5672f25fb9ba28133c20f..950519b6e879e2beb71498eb692d7fa29e23f1be 100644 (file)
@@ -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).
 
index 13ea8b933933a3ea6321123d09ddd796e25b6629..efc1fafe0c6661f030a48c20d12f5fc984424723 100644 (file)
@@ -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;
index c2a86b6ebc86e8015366bd443f98a897c186e95f..eb15296bb2a22b065ab76f69a150e6cf714f2828 100644 (file)
@@ -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]");
index e0a68bb9d8350b779c24832a49959be0ff0785d7..dcd162130441b40901582dbe4803f5fe988a8485 100644 (file)
@@ -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.