]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
04-oct-2007 NvE New memberfunctions GetLevel and GetOMId introduced in class IceGOM
authornick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Oct 2007 11:33:06 +0000 (11:33 +0000)
committernick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Oct 2007 11:33:06 +0000 (11:33 +0000)
                to enable retrieval and conversion of various (D)OM numbering schemes.
04-oct-2007 NvE New class IceDB2Root of Garmt de Vries-Uiterweerd introduced.

RALICE/icepack/IceGOM.cxx
RALICE/icepack/IceGOM.h
RALICE/icepack/history.txt
RALICE/icepack/iceconvert/ICEConvHeaders.h
RALICE/icepack/iceconvert/ICEConvLinkDef.h
RALICE/icepack/iceconvert/IceCal2Root.cxx
RALICE/icepack/iceconvert/history.txt

index 9483a36402898f937e2f97316975aaea0d3c32ec..3eaf092a543f66c19efd74f490b6fd0a179971c9 100644 (file)
@@ -130,15 +130,23 @@ IceGOM::IceGOM(const IceGOM& m) : AliDevice(m)
 // Copy constructor.
 }
 ///////////////////////////////////////////////////////////////////////////
-Int_t IceGOM::GetString() const
+Int_t IceGOM::GetString(Int_t id) const
 {
 // Provide the corresponding string number for this module.
 // Note : Amanda string numbers will have negative values.
+//
+// In case the user has specified the input argument id>0,
+// the string number corresponding to this id for the current module class
+// will be returned.
+// Otherwise the string number corresponding with the current
+// module will be returned.
+//
+// The default value is id=0;
 
  Int_t omid=GetUniqueID();
+ if (id>0) omid=id;
 
  if (omid<=0) return 0;
- if (omid==681) return -18;
 
  Int_t string=0;
  if (InheritsFrom("IceAOM"))
@@ -162,6 +170,9 @@ Int_t IceGOM::GetString() const
   if (omid>=555 && omid<=596) return -17;
   if (omid>=597 && omid<=638) return -18;
   if (omid>=639 && omid<=680) return -19;
+
+  // OM681 is a special case on string 18
+  if (omid==681) return -18;
  }
  else
  {
@@ -171,6 +182,88 @@ Int_t IceGOM::GetString() const
  return string;
 }
 ///////////////////////////////////////////////////////////////////////////
+Int_t IceGOM::GetLevel(Int_t id) const
+{
+// Provide the corresponding level on the string for this module.
+// Level=j indicates the j-th module on the string, where j=1
+// corresponds to the module at the top of the string.
+//
+// In case the user has specified the input argument id>0,
+// the string number corresponding to this id for the current module class
+// will be returned.
+// Otherwise the string number corresponding with the current
+// module will be returned.
+//
+// The default value is id=0;
+//              
+// Note : level 61,62,63,64 indicates IceTop DOM's.
+
+ Int_t omid=GetUniqueID();
+ if (id>0) omid=id;
+
+ if (omid<=0) return 0;
+
+ Int_t level=0;
+ if (InheritsFrom("IceAOM"))
+ {
+  if (omid<=20) return omid;
+  if (omid>=21 && omid<=40) return (omid-20);
+  if (omid>=41 && omid<=60) return (omid-40);
+  if (omid>=61 && omid<=86) return (omid-60);
+  if (omid>=87 && omid<=122) return (omid-86);
+  if (omid>=123 && omid<=158) return (omid-122);
+  if (omid>=159 && omid<=194) return (omid-158);
+  if (omid>=195 && omid<=230) return (omid-194);
+  if (omid>=231 && omid<=266) return (omid-230);
+  if (omid>=267 && omid<=302) return (omid-266);
+  if (omid>=303 && omid<=344) return (omid-302);
+  if (omid>=345 && omid<=386) return (omid-344);
+  if (omid>=387 && omid<=428) return (omid-386);
+  if (omid>=429 && omid<=470) return (omid-428);
+  if (omid>=471 && omid<=512) return (omid-470);
+  if (omid>=513 && omid<=554) return (omid-512);
+  if (omid>=555 && omid<=596) return (omid-554);
+  if (omid>=597 && omid<=638) return (omid-596);
+  if (omid>=639 && omid<=680) return (omid-638);
+
+  // OM681 is physically the 4th module on string 18
+  // but the database convention is to regard it as
+  // a module at the bottom of string 18
+  if (omid==681) return 43;
+ }
+ else
+ {
+  level=omid%100;
+ }
+
+ return level;
+}
+///////////////////////////////////////////////////////////////////////////
+Int_t IceGOM::GetOMId(Int_t string,Int_t level) const
+{
+// Provide OM identifier based on the string and level indicators.
+// This memberfunction makes use of the inheritance info, which means
+// that for Amanda OM's one may either use negative or positive string numbers.
+
+ Int_t omid=0;
+ Int_t s=0,l=0;
+ if (InheritsFrom("IceAOM"))
+ {
+  for (Int_t i=1; i<=681; i++)
+  {
+   s=GetString(i);
+   l=GetLevel(i);
+   if (abs(s)==abs(string) && l==level) return i;
+  }
+ }
+ else
+ {
+  omid=100*string+level;
+ }
+
+ return omid;
+}
+///////////////////////////////////////////////////////////////////////////
 TObject* IceGOM::Clone(const char* name) const
 {
 // Make a deep copy of the current object and provide the pointer to the copy.
index 9cd7f5bf77b96f17e0b03003469a7c6dc95caa98..e3d17d90da1b51d3d7d9ff103b37f2fd24d32f8d 100644 (file)
@@ -15,8 +15,10 @@ class IceGOM : public AliDevice
   virtual ~IceGOM();                                 // Default destructor
   IceGOM(const IceGOM& m);                           // Copy constructor
   virtual TObject* Clone(const char* name="") const; // Make a deep copy and provide its pointer
-  Int_t GetString() const;                           // Provide the corresponding string number
+  Int_t GetString(Int_t id=0) const;                 // Provide the corresponding string number
+  Int_t GetLevel(Int_t id=0) const;                  // Provide the corresponding level on the string
+  Int_t GetOMId(Int_t string,Int_t level) const;     // Provide ID based on string and level indicators
 
- ClassDef(IceGOM,2) // Signal (Hit) handling of a generic IceCube Optical Module (GOM).
+ ClassDef(IceGOM,3) // Signal (Hit) handling of a generic IceCube Optical Module (GOM).
 };
 #endif
index ea1815cb01bac393267fed90b300f194aa947f5f..2720ff629700311acfc58ea4a2f4491214eba1ad 100644 (file)
 27-sep-2007 NvE Check for event selection/rejection flag introduced in IceCalibrate.cxx,
                 IceChi2.cxx, IceCleanHits.cxx, IceDwalk.cxx, IceDwalkx.cxx, IceLinefit.cxx,
                 IceMakeHits.cxx, IcePandel.cxx and IceXtalk.cxx.
+04-oct-2007 NvE New memberfunctions GetLevel and GetOMId introduced in class IceGOM
+                to enable retrieval and conversion of various (D)OM numbering schemes.
+
                  
index b726ab02e4e01bda01f53c63b31bc790a83281a2..9f321996a528297685c9c5b2cd45cd50c3861b67 100644 (file)
@@ -12,4 +12,5 @@
 #include "IceCal2Root.h"
 #include "IceRawTWR.h"
 #include "IceRoot.h"
+#include "IceDB2Root.h"
 
index d15bce4b1f26f3ef4b961092b94f255843c15982..40600689f0d7e727d99d05e2746a9e3622b4ee2a 100644 (file)
@@ -17,5 +17,6 @@
  #pragma link C++ class IceCal2Root+;
  #pragma link C++ class IceRawTWR+;
  #pragma link C++ class IceRoot+;
+ #pragma link C++ class IceDB2Root+;
 #endif
  
index 6b7c900669850703eed580f7d538cb4dae8a4389..4e60f2ef7dd580df94936a884bfe5a764c5063f0 100644 (file)
 // Class IceCal2Root
 // Conversion of Amanda (ascii) calibration data into a AliObjMatrix objects
 // containing the complete OM position, calibration, Xtalk etc... database.
+//
+// This facility will become obsolete soon and is only kept for
+// backward compatibility and testing purposes.
+// Please use the more recent IceDB2Root facility instead.
+//
 // Via specification of the various input files, various AliObjMatrix objects
 // are created and (optionally) stored in a single output file.
 // The names of the AliObjMatrix objects indicate the type of database they
index eb1de360cca40de3eb11675a9e981a1d4acc4b71..50a4957d690c2fdaf007009fd88de1c25fe9b14e 100644 (file)
                 and slot access exclusively via the slotname, to enhance flexibility.
 27-sep-2007 NvE Check for event selection flag introduced in IceF2k.cxx and IceRawTWR.cxx
                 to provide selected event output.
+04-oct-2007 NvE New class IceDB2Root of Garmt de Vries-Uiterweerd introduced.