]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- adding functionality for loading detector geometries from OCDB or ROOT file
authorodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 11:24:44 +0000 (11:24 +0000)
committerodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 11:24:44 +0000 (11:24 +0000)
HLT/trigger/AliHLTTriggerBarrelGeomMultiplicity.cxx
HLT/trigger/AliHLTTriggerBarrelGeomMultiplicity.h
HLT/trigger/AliHLTTriggerDetectorGeom.cxx
HLT/trigger/AliHLTTriggerDetectorGeom.h

index 8b0dc867177bbfc6b790385c4ce21da0dcc42174..5e9ddeee6961110dc6bc7f6ec5d91a7feda70ff2 100644 (file)
@@ -17,8 +17,8 @@
 /// @file   AliHLTTriggerBarrelGeomMultiplicity.cxx
 /// @author Oystein Djuvsland
 /// @date   2009-10-08
-/// @brief  HLT trigger component for charged particle multiplicity in
-///         the central barrel.
+/// @brief  HLT trigger component for charged particle multiplicity 
+///         within a geometrical acceptance in the central barrel.
 
 // see header file for class documentation
 // or
 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
 
 #include "AliHLTTriggerBarrelGeomMultiplicity.h"
+#include "AliHLTTriggerDetectorGeom.h"
 #include "AliESDEvent.h"
 #include "AliHLTTriggerDecision.h"
 #include "AliHLTDomainEntry.h"
 #include "AliHLTGlobalBarrelTrack.h"
 #include "TObjArray.h"
 #include "TObjString.h"
+#include "TObjArray.h"
+#include "TVector3.h"
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+#include "TFile.h"
+#include "AliHLTTrigger.h"
 
 /** ROOT macro for the implementation of ROOT specific class methods */
 ClassImp(AliHLTTriggerBarrelGeomMultiplicity)
 
 AliHLTTriggerBarrelGeomMultiplicity::AliHLTTriggerBarrelGeomMultiplicity()
   : AliHLTTrigger()
-  , fMinTracks(1)
-  , fSolenoidBz(0.0)
+  , fSolenoidBz(0)
+  , fMinTracks(0)
+  , fDetectorArray(0)
 {
   // see header file for class documentation
   // or
@@ -50,16 +58,16 @@ AliHLTTriggerBarrelGeomMultiplicity::AliHLTTriggerBarrelGeomMultiplicity()
 
 }
 
-const char* AliHLTTriggerBarrelGeomMultiplicity::fgkOCDBEntry="HLT/ConfigHLT/BarrelGeomMultiplicityTrigger";
-
 AliHLTTriggerBarrelGeomMultiplicity::~AliHLTTriggerBarrelGeomMultiplicity()
 {
   // see header file for class documentation
 }
 
-const char* AliHLTTriggerBarrelGeomMultiplicity::GetTriggerName() const
+const char* AliHLTTriggerBarrelGeomMultiplicity::GetTriggerName() const 
 {
   // see header file for class documentation
+  const char* name = fTriggerName;
+  if(name) return name;
   return "BarrelGeomMultiplicityTrigger";
 }
 
@@ -69,6 +77,22 @@ AliHLTComponent* AliHLTTriggerBarrelGeomMultiplicity::Spawn()
   return new AliHLTTriggerBarrelGeomMultiplicity;
 }
 
+int AliHLTTriggerBarrelGeomMultiplicity::Reconfigure(const char *cdbEntry, const char *chainId)
+{
+  // see header file for class documentation
+
+  // configure from the specified entry or the default
+  const char* entry=cdbEntry;
+
+  if (!entry)
+    {
+      HLTDebug("No CDB path specified");
+      entry = fOCDBEntry; 
+    }
+
+  return GetDetectorGeomsFromCDBObject(entry, chainId);
+} 
+
 int AliHLTTriggerBarrelGeomMultiplicity::DoTrigger()
 {
   // see header file for class documentation
@@ -79,74 +103,57 @@ int AliHLTTriggerBarrelGeomMultiplicity::DoTrigger()
   const TObject* obj = GetFirstInputObject(kAliHLTAllDataTypes, "AliESDEvent");
   AliESDEvent* esd = dynamic_cast<AliESDEvent*>(const_cast<TObject*>(obj));
   TString description;
-  TString ptcut,tdca,ldca,dcaref,op1st,op2nd;
-  if (esd != NULL) {
-    numberOfTracks=0;
-    esd->GetStdContent();
+  if (esd != NULL) 
+    {
+      numberOfTracks=0;
+      esd->GetStdContent();
     
-    for (Int_t i = 0; i < esd->GetNumberOfTracks(); i++) {
-      if (CheckCondition(esd->GetTrack(i), esd->GetMagneticField())) numberOfTracks++;
+      for (Int_t i = 0; i < esd->GetNumberOfTracks(); i++) 
+       {
+         if (CheckCondition(esd->GetTrack(i), esd->GetMagneticField())) numberOfTracks++;
+       }
     }
-  }
 
   // try the AliHLTExternal track data as input
-  if (iResult>=0 && numberOfTracks<0) {
-    for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack);
-        pBlock!=NULL; pBlock=GetNextInputBlock()) {
-      if (numberOfTracks<0) numberOfTracks=0;
-      vector<AliHLTGlobalBarrelTrack> tracks;
-      if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) {
-       for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
-            element!=tracks.end(); element++) {
-         if (CheckCondition(&(*element), fSolenoidBz)) numberOfTracks++;
+  if (iResult>=0 && numberOfTracks<0) 
+    {
+      for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack);
+          pBlock!=NULL; pBlock=GetNextInputBlock()) 
+       {
+         if (numberOfTracks<0) numberOfTracks=0;
+         vector<AliHLTGlobalBarrelTrack> tracks;
+         if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) 
+           {
+             for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
+                  element!=tracks.end(); element++) 
+               {
+                 if (CheckCondition(&(*element), fSolenoidBz)) numberOfTracks++;
+               }
+           } 
+         else if (iResult<0) 
+           {
+             HLTError("can not extract tracks from data block of type %s (specification %08x) of size %d: error %d", 
+                      DataType2Text(pBlock->fDataType).c_str(), pBlock->fSpecification, pBlock->fSize, iResult);
+           }
        }
-      } else if (iResult<0) {
-       HLTError("can not extract tracks from data block of type %s (specification %08x) of size %d: error %d", 
-                DataType2Text(pBlock->fDataType).c_str(), pBlock->fSpecification, pBlock->fSize, iResult);
-      }
     }
-  }
-  if (numberOfTracks>=fMinTracks) {
-
-    ApplyTrigger();
-
-    description.Form("Event contains %d track(s) with ", numberOfTracks);
-    SetDescription(description.Data());
-    // Enable the central detectors for readout.
-    GetReadoutList().Enable(
-                           AliHLTReadoutList::kITSSPD |
-                           AliHLTReadoutList::kITSSDD |
-                           AliHLTReadoutList::kITSSSD |
-                           AliHLTReadoutList::kTPC |
-                           AliHLTReadoutList::kTRD |
-                           AliHLTReadoutList::kTOF |
-                           AliHLTReadoutList::kHMPID |
-                           AliHLTReadoutList::kPHOS
-                           );
-      // Add the available HLT information for readout too.
-      GetTriggerDomain().Add("CLUSTERS", "TPC ");
-      TriggerEvent(true);
-      return 0;
+  if (numberOfTracks>=fMinTracks) 
+    {
+      description.Form("Event contains %d track(s) satisfying geometrical cut", numberOfTracks);
+      SetDescription(description);
+
+      TriggerEvent(fTriggerDecision);
     }
-    description.Form("No tracks matching the tresholds found in the central barrel (min tracks %d, ", fMinTracks);
-    description+=ptcut;
-    description+=op1st;
-    description+=ldca;
-    description+=op2nd;
-    description+=tdca;
-    description+=dcaref;
-    description+=")";
-  } else {
-    description.Form("No input blocks found");
-  }
-  SetDescription(description.Data());
-  TriggerEvent(false);
+  
   return iResult;
+
 }
 
 template<class T>
 bool AliHLTTriggerBarrelGeomMultiplicity::CheckCondition(T* track, float b)
 {
+  bool ret = false;
+
   // see header file for class documentation
   if (!track) return false;
 
@@ -157,22 +164,24 @@ bool AliHLTTriggerBarrelGeomMultiplicity::CheckCondition(T* track, float b)
 }
 
 template<class T>
-bool AliHLTTriggerBarrelGeomMultiplicity::IsInDetector(T* track, b)
+bool AliHLTTriggerBarrelGeomMultiplicity::IsInDetectors(T* track, float b)
 {
-
-  for(Int_t i = 0; i < fDetectorList->GetEntries(); i++)
+  // See header file for class documentation  
+  for(Int_t i = 0; i < fDetectorArray->GetEntries(); i++)
     {
-      AliHLTTriggerDetectorGeom *det = static_cast<AliHLTTriggerDetectorGeom*>(fDetectorList.At(i))
+      AliHLTTriggerDetectorGeom *det = static_cast<AliHLTTriggerDetectorGeom*>(fDetectorArray->At(i));
       Double_t trackPoint[3];
-
+      
       det->GetInitialPoint(trackPoint);
-
+      
       bool ret = track->Intersect(trackPoint, det->NormVector(), b);
 
-      if(track->Eta() >= det->EtaMin() && 
-        track->Eta() <= det->EtaMax() &&
-        track->Phi() >= det->PhiMin() &&
-        track->Phi() <= det->PhiMax())
+      TVector3 trackPos(trackPoint);
+      
+      if(trackPos.Eta() >= det->EtaMin() && 
+        trackPos.Eta() <= det->EtaMax() &&
+        trackPos.Phi() >= det->PhiMin() &&
+        trackPos.Phi() <= det->PhiMax())
        {
          return true;
        }
@@ -186,136 +195,156 @@ int AliHLTTriggerBarrelGeomMultiplicity::DoInit(int argc, const char** argv)
 
   // first configure the default
   int iResult=0;
-  iResult=ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz);
-  if (iResult>=0) iResult=ConfigureFromCDBTObjString(fgkOCDBEntry);
 
-  // configure from the command line parameters if specified
   if (iResult>=0 && argc>0)
     iResult=ConfigureFromArgumentString(argc, argv);
+
+
   return iResult;
 }
 
 int AliHLTTriggerBarrelGeomMultiplicity::DoDeinit()
-{
+ {
   // see header file for class documentation
   return 0;
 }
 
-int AliHLTTriggerBarrelGeomMultiplicity::Reconfigure(const char* cdbEntry, const char* /*chainId*/)
+int AliHLTTriggerBarrelGeomMultiplicity::ReadPreprocessorValues(const char* /*modules*/)
 {
   // see header file for class documentation
 
-  // configure from the specified antry or the default one
-  const char* entry=cdbEntry;
-  if (!entry || entry[0]==0) {
-    ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz);
-    entry=fgkOCDBEntry;
-  }
+  // TODO 2009-10-10: implementation
+  // for the moment very quick, just reload the magnetic field
+  return ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz);
+}
+
+int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromCDBObject(const char *cdbEntry, const char* chainId)
+{
+    // see header file for function documentation
+  int nDetectorGeoms=0;
+  const char *path = cdbEntry;
+  if(!path) path = fOCDBEntry;
 
-  return ConfigureFromCDBTObjString(entry);
+  if(path)
+    {
+      //     const char* chainId=GetChainId();
+      HLTInfo("configure from entry %s, chain id %s", path, (chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
+      AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/);
+      if (pEntry) 
+       {
+         TObjArray* pArr=dynamic_cast<TObjArray*>(pEntry->GetObject());
+         if (pArr) 
+           {
+
+             for(int i = 0; i < pArr->GetEntries(); i++)
+               {
+                 if(!strcmp(pArr->At(i)->ClassName(), "AliHLTTriggerDecision"))
+                   {
+                     fTriggerDecision = dynamic_cast<AliHLTTriggerDecision*>(pArr->At(i));
+                   }
+                 else if(!strcmp(pArr->At(i)->ClassName(), "AliHLTTriggerDetectorGeom"))
+                   {
+                     fDetectorArray->AddLast(dynamic_cast<AliHLTTriggerDetectorGeom*>(pArr->At(i)));
+                     nDetectorGeoms++;
+                     HLTInfo("received TObjArray of %d detector geometries", nDetectorGeoms);
+                   }
+                 else
+                   {
+                     HLTWarning("Unknown object in configuration object");
+                   }
+               }
+           } 
+         else 
+           {
+             HLTError("configuration object \"%s\" has wrong type, required TObjArray", path);
+             nDetectorGeoms=-EINVAL;
+           }
+       }
+      else 
+       {
+         HLTError("can not fetch object \"%s\" from OCDB", path);
+         nDetectorGeoms=-ENOENT;
+       }
+    }
+  return nDetectorGeoms;
 }
 
-int AliHLTTriggerBarrelGeomMultiplicity::ReadPreprocessorValues(const char* /*modules*/)
+int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromFile(const char *filename)
 {
-  // see header file for class documentation
+    // see header file for function documentation
+  int nDetectorGeoms=0;
 
-  // TODO 2009-09-10: implementation
-  // for the moment very quick, just reload the magnetic field
-  return ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz);
+  if (filename) 
+    {
+      TFile *geomfile = TFile::Open(filename, "READ");
+      
+      if(geomfile)
+       {
+         
+         HLTInfo("configure from file \"%s\"", filename);
+         TObjArray* pArr=dynamic_cast<TObjArray*>(geomfile->Get("GeomConfig"));
+         if (pArr) 
+           {
+
+             for(int i = 0; i < pArr->GetEntries(); i++)
+               {
+                 if(!strcmp(pArr->At(i)->ClassName(), "AliHLTTriggerDecision"))
+                   {
+                     fTriggerDecision = dynamic_cast<AliHLTTriggerDecision*>(pArr->At(i));
+                   }
+                 else if(!strcmp(pArr->At(i)->ClassName(), "AliHLTTriggerDetectorGeom"))
+                   {
+                     fDetectorArray->AddLast(dynamic_cast<AliHLTTriggerDetectorGeom*>(pArr->At(i)));
+                     nDetectorGeoms++;
+                     HLTInfo("received TObjArray of %d detector geometries", nDetectorGeoms);
+                   }
+                 else
+                   {
+                     HLTWarning("Unknown object in configuration object");
+                   }
+               }
+           } 
+         else 
+           {
+             HLTError("configuration object has wrong type, required TObjArray");
+             nDetectorGeoms=-EINVAL;
+           }
+         } 
+      else 
+       {
+         HLTError("can not open file \"%s\"", filename);
+         nDetectorGeoms=-ENOENT;
+       }
+    }
+  return nDetectorGeoms;
 }
 
 int AliHLTTriggerBarrelGeomMultiplicity::ScanConfigurationArgument(int argc, const char** argv)
 {
-  // see header file for class documentation
+  // See header file for class documentation
   if (argc<=0) return 0;
   int i=0;
   TString argument=argv[i];
 
   // -maxpt
-  if (argument.CompareTo("-maxpt")==0) {
-    if (++i>=argc) return -EPROTO;
-    argument=argv[i];
-    fPtMax=argument.Atof();
-    return 2;
-  }    
-
-  // -minpt
-  if (argument.CompareTo("-minpt")==0) {
-    if (++i>=argc) return -EPROTO;
-    argument=argv[i];
-    fPtMin=argument.Atof();
-    return 2;
-  }    
+  if (argument.CompareTo("-geomfile")==0) 
+    {
+      if (++i>=argc) return -EPROTO;
+    
+      GetDetectorGeomsFromFile(argv[i]);
+    
+      return 2;
+    }    
 
-  // -mintracks
-  if (argument.CompareTo("-mintracks")==0) {
-    if (++i>=argc) return -EPROTO;
-    argument=argv[i];
-    fMinTracks=argument.Atoi();
-    return 2;
+  if (argument.CompareTo("-triggername")==0) 
+    {
+      if (++i>=argc) return -EPROTO;
+      
+      fTriggerName = new char[128];
+      sprintf(fTriggerName, argv[i]);
+      
+      fOCDBEntry = fTriggerName;
+
+      return 2;
   }    
-
-  // -dca-reference
-  // reference point for the transverse and longitudinal dca cut
-  if (argument.CompareTo("-dca-reference")==0) {
-    if (++i>=argc) return -EPROTO;
-    argument=argv[i];
-    // scan x,y,z
-    TObjArray* pTokens=argument.Tokenize("'");
-    if (pTokens) {
-      for (int c=0; c<pTokens->GetEntriesFast() && c<fgkDCAReferenceSize; c++) {
-       argument=((TObjString*)pTokens->At(c))->GetString();
-       fDCAReference[i]=argument.Atof();
-      }
-      delete pTokens;
-    }
-    return 2;
-  }
-
-  // -min-ldca
-  // minimum longitudinal dca to reference point
-  if (argument.CompareTo("-min-ldca")==0) {
-    if (++i>=argc) return -EPROTO;
-    argument=argv[i];
-    fMinLDca=argument.Atof();
-    return 2;
-  }
-  
-  // -max-ldca
-  // maximum longitudinal dca to reference point
-  if (argument.CompareTo("-max-ldca")==0) {
-    if (++i>=argc) return -EPROTO;
-    argument=argv[i];
-    fMaxLDca=argument.Atof();
-    return 2;
-  }
-
-  // -min-tdca
-  // minimum transverse dca to reference point
-  if (argument.CompareTo("-min-tdca")==0) {
-    if (++i>=argc) return -EPROTO;
-    argument=argv[i];
-    fMinTDca=argument.Atof();
-    return 2;
-  }
-  
-  // -max-tdca
-  // maximum transverse dca to reference point
-  if (argument.CompareTo("-max-tdca")==0) {
-    if (++i>=argc) return -EPROTO;
-    argument=argv[i];
-    fMaxTDca=argument.Atof();
-    return 2;
-  }
-
-  // -solenoidBz
-  if (argument.CompareTo("-solenoidBz")==0) {
-    if (++i>=argc) return -EPROTO;
-    argument=argv[i];
-    fSolenoidBz=argument.Atof();
-    return 2;
-  }
-
-  // unknown argument
-  return -EINVAL;
 }
index 9b220015aa019bc2833438d476d520d5ba350720..f546a7f0f6a2d6aba00275222b1202da211bd25c 100644 (file)
@@ -11,7 +11,7 @@
 ///         a geometrical selection of the central barrel.
 
 #include "AliHLTTrigger.h"
-
+#include "TList.h"
 /**
  * @class  AliHLTTriggerBarrelGeomMultiplicity
  * HLT trigger component for charged particle multiplicity in the
  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
  * \li -mintracks     <i> n   </i> <br>
  *      required number of tracks for a trigger
- * \li -minpt    <i> pt  </i> <br>
- *      required minimum pt for a trigger
- * \li -maxpt    <i> pt  </i> <br>
- *      required maximum pt for a trigger
- * \li -dca-reference    <i> x,y,z  </i> <br>
- *      reference point for the transverse and longitudinal dca cut
- * \li -min-ldca    <i> dca  </i> <br>
- *      minimum longitudinal dca to reference point
- * \li -max-ldca    <i> dca  </i> <br>
- *      maximum longitudinal dca to reference point
- * \li -min-tdca    <i> dca  </i> <br>
- *      minimum transverse dca to reference point
- * \li -max-tdca    <i> dca  </i> <br>
- *      maximum transverse dca to reference point
  * \li  -solenoidBz    <i> field  </i> <br>
  *      magnetic field needed if the input is not an ESD object
  *
@@ -58,7 +44,7 @@
  * component arguments.
  *
  * <h2>Default CDB entries:</h2>
- * HLT/ConfigHLT/BarrelGeomMultiplicityTrigger: TObjString storing the arguments
+ * HLT/ConfigHLT/BarrelGeomMultiplicityTrigger: TList storing the detector geometries
  * HLT/ConfigHLT/Solenoidbz: TObjString -solenoidBz field
  *
  * <h2>Performance:</h2>
 class AliHLTTriggerBarrelGeomMultiplicity : public AliHLTTrigger
 {
  public:
+
   AliHLTTriggerBarrelGeomMultiplicity();
   ~AliHLTTriggerBarrelGeomMultiplicity();
 
-  /// inherited from AliHLTTrigger: name of this trigger
-  virtual const char* GetTriggerName() const;
   /// inherited from AliHLTComponent: create an instance
   virtual AliHLTComponent* Spawn();
 
+  /// inherited from AliHLTTrigger: name of this trigger
+  virtual const char* GetTriggerName() const;
+
  protected:
   /// inherited from AliHLTComponent: handle the initialization
   int DoInit(int argc, const char** argv);
@@ -90,34 +78,56 @@ class AliHLTTriggerBarrelGeomMultiplicity : public AliHLTTrigger
   /// inherited from AliHLTComponent: handle cleanup
   int DoDeinit();
 
-  /// inherited from AliHLTComponent: handle re-configuration event
-  int Reconfigure(const char* cdbEntry, const char* chainId);
-
   /// inherited from AliHLTComponent: handle dcs update event
   int ReadPreprocessorValues(const char* modules);
 
   /// inherited from AliHLTComponent, scan one argument and
   /// its parameters
-  int ScanConfigurationArgument(int argc, const char** argv);
+  virtual int ScanConfigurationArgument(int argc, const char** argv);
+  
+  // Get the detector geometries from CDB entry
+  virtual int GetDetectorGeomsFromCDBObject(const char *cdbEntry, const char *chainId);
+
+  // Get the detector geometries from a root file
+  virtual int GetDetectorGeomsFromFile(const char *filename);
+
+  /// inherited from AliHLTComponent: handle re-configuration event
+  int Reconfigure(const char* cdbEntry = 0, const char* chainId = 0);
 
  private:
 
   /// inherited from AliHLTTrigger: calculate the trigger
-  virtual int DoTrigger
+  virtual int DoTrigger();
 
   /// check whether a track meets the criteria  
   template<class T>
   bool CheckCondition(T* track, float b);
 
   // check whether a track is in the desired detectors
-  Template<Class T>
-  bool IsInDetector(T* track, float b);
+  template<class T>
+  bool IsInDetectors(T* track, float b);
+
+  // magnetic field (dca estimation for)
+  Float_t fSolenoidBz; 
+
+  // minimum number of tracks satisfying the cut
+  Int_t fMinTracks;
+
+  // array of (sub-)detectors to trigger on
+  TObjArray *fDetectorArray; // !transient
+
+  // Trigger decision
+  AliHLTTriggerDecision *fTriggerDecision; //!transient
+
+  // The trigger name
+  char *fTriggerName; //!transient
+  
+  /// the default configuration entry for this component
+  char* fOCDBEntry; //!transient
 
-  // abstract method for setting the correct trigger parameters
-  void ApplyTrigger() = 0;
 
-  ClassDef(AliHLTTriggerBarrelMultiplicity, 0);
+  ClassDef(AliHLTTriggerBarrelGeomMultiplicity, 0);
 
 };
 
-#endif ALIHLTTRIGGERBARRELGEOMMULTIPLICITY_H
+#endif 
index 0a40ee58640d7e928d73b3d651cf6834be84b2f9..78f1d01f8e0616e93abea3f1973c8212a64d3242 100644 (file)
@@ -27,7 +27,7 @@
 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
 
 #include "AliHLTTriggerDetectorGeom.h"
-
+#include <ostream>
 /** ROOT macro for the implementation of ROOT specific class methods */
 ClassImp(AliHLTTriggerDetectorGeom)
 
@@ -37,8 +37,6 @@ AliHLTTriggerDetectorGeom::AliHLTTriggerDetectorGeom()
   fEtaMax(0),
   fPhiMin(0),
   fPhiMax(0),
-  fInitalPoint(0),
-  fNormVector(0),
   fName('\0')
 {
   // See header file for class documentation
@@ -54,7 +52,7 @@ AliHLTTriggerDetectorGeom::~AliHLTTriggerDetectorGeom()
   // See header file for class documentation
 }
 
-void AliHLTTriggerDetectorGeom::SetInitialPoint(Double_t &point[3])
+void AliHLTTriggerDetectorGeom::SetInitialPoint(Double_t *point)
 {
   // See header file for class documentation
   for(int i = 0; i < 3; i++)
@@ -63,7 +61,7 @@ void AliHLTTriggerDetectorGeom::SetInitialPoint(Double_t &point[3])
     }
 }
 
-void AliHLTTriggerDetectorGeom::SetNormVector(Double_t &nVector[3])
+void AliHLTTriggerDetectorGeom::SetNormVector(Double_t *nVector)
 {
   // See header file for class documentation
   for(int i = 0; i < 3; i++)
@@ -71,3 +69,22 @@ void AliHLTTriggerDetectorGeom::SetNormVector(Double_t &nVector[3])
       fNormVector[i] = nVector[i];
     }
 }
+
+void AliHLTTriggerDetectorGeom::GetInitialPoint(Double_t *point)
+{
+  for(int i = 0; i < 3; i++)
+    {
+      point[i] = fInitalPoint[i];
+    }
+}
+
+void AliHLTTriggerDetectorGeom::PrintDetectorGeom(std::ostream &out)
+{
+  out << "Name: " << fName << std::endl;
+  out << "Eta Min: " << fEtaMin << std::endl;
+  out << "Eta Max: " << fEtaMax << std::endl;
+  out << "Phi Min: " << fPhiMin << std::endl;
+  out << "Phi Max: " << fPhiMax << std::endl;
+  out << "Initial Point: {" << fInitalPoint[0] << ", " << fInitalPoint[1] << ", " << fInitalPoint[2] << std::endl; 
+  out << "Normal Vector: {" << fNormVector[0] << ", " << fNormVector[1] << ", " << fNormVector[2] << std::endl; 
+}
index e74c46a238fe5a015d7c025bf9b42d8aee9d5122..1f42140e1a5836eb193add18379290f976f070e5 100644 (file)
@@ -12,6 +12,8 @@
 ///         Used for the AliHLTTriggerBarrelGeomMultiplicity classes
 
 #include "TObject.h"
+#include "TString.h"
+#include <ostream>
 
 /**
  * @class  AliHLTTriggerDetectorGeom
@@ -59,19 +61,31 @@ public:
    * Set the initial point describing the plane
    * @param point is the point
    */
-  void SetInitialPoint(Double_t &point[3]); // Set initial point
+  void SetInitialPoint(Double_t *point); // Set initial point
 
   /** 
    * Set the vector describing the plane
    * @param nVector is a the vector
    */
-  void SetNormVector(Double_t &nVector[3]); // Set normal vector
+  void SetNormVector(Double_t *nVector); // Set normal vector
 
   /**
    * Set the name of the (sub-)detector
    * @param name is the name
    */
-  void SetName(TString &name) { fName = name; } // Set name
+  void SetDetName(TString &name) { fName = name; } // Set name
+
+  Double_t EtaMin() { return fEtaMin; }
+  Double_t EtaMax() { return fEtaMax; }
+  Double_t PhiMin() { return fPhiMin; }
+  Double_t PhiMax() { return fPhiMax; }
+
+  void GetInitialPoint(Double_t *point);
+  Double_t* NormVector() { return fNormVector; }
+  
+  TString DetName() { return fName; }
+
+  void PrintDetectorGeom(std::ostream &out);
 
 private: