]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Modifications to the geometry trigger classes. The trigger has now been tested with...
authorodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 11:25:06 +0000 (11:25 +0000)
committerodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 11:25:06 +0000 (11:25 +0000)
HLT/trigger/AliHLTTriggerBarrelGeomMultiplicity.cxx
HLT/trigger/AliHLTTriggerBarrelGeomMultiplicity.h
HLT/trigger/AliHLTTriggerBarrelMultiplicity.cxx
HLT/trigger/AliHLTTriggerDecisionParameters.h
HLT/trigger/AliHLTTriggerDetectorGeom.cxx
HLT/trigger/AliHLTTriggerDetectorGeom.h
HLT/trigger/AliHLTTriggerDetectorGeomRectangle.cxx
HLT/trigger/AliHLTTriggerDetectorGeomRectangle.h

index ab42b9f9999d5d726e0b808b01eb7c4f793b5224..5fb4430237abcc6095783c47fb56785db9a30dd6 100644 (file)
@@ -2,7 +2,7 @@
 //* This file is property of and copyright by the ALICE HLT Project        * 
 //* ALICE Experiment at CERN, All rights reserved.                         *
 //*                                                                        *
-//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
+//* Primary Authors: Oystein Djuvsland                                     *
 //*                  for The ALICE HLT Project.                            *
 //*                                                                        *
 //* Permission to use, copy, modify and distribute this software and its   *
@@ -50,6 +50,9 @@ AliHLTTriggerBarrelGeomMultiplicity::AliHLTTriggerBarrelGeomMultiplicity()
   , fSolenoidBz(0)
   , fMinTracks(1)
   , fDetectorArray(0)
+  , fTriggerDecisionPars(0)
+  , fTriggerName(0)
+  , fOCDBEntry(0)
 {
   // see header file for class documentation
   // or
@@ -103,13 +106,13 @@ int AliHLTTriggerBarrelGeomMultiplicity::DoTrigger()
 
   // try the ESD as input
   const TObject* obj = GetFirstInputObject(kAliHLTAllDataTypes, "AliESDEvent");
-  AliESDEvent* esd = dynamic_cast<AliESDEvent*>(const_cast<TObject*>(obj));
+n  AliESDEvent* esd = dynamic_cast<AliESDEvent*>(const_cast<TObject*>(obj));
   TString description;
   if (esd != NULL) 
     {
       numberOfTracks=0;
       esd->GetStdContent();
-    
+
       for (Int_t i = 0; i < esd->GetNumberOfTracks(); i++) 
        {
          if (CheckCondition(esd->GetTrack(i), esd->GetMagneticField())) numberOfTracks++;
@@ -139,9 +142,9 @@ int AliHLTTriggerBarrelGeomMultiplicity::DoTrigger()
            }
        }
     }
+
   if (numberOfTracks>=fMinTracks) 
     {
-
       SetDescription(fTriggerDecisionPars->GetDescription());
       AliHLTReadoutList readout(fTriggerDecisionPars->GetReadoutListParameter());
       AliHLTTriggerDecision decision(
@@ -178,12 +181,19 @@ bool AliHLTTriggerBarrelGeomMultiplicity::IsInDetectors(T* track, float b)
   for(Int_t i = 0; i < fDetectorArray->GetEntries(); i++)
     {
       AliHLTTriggerDetectorGeom *det = static_cast<AliHLTTriggerDetectorGeom*>(fDetectorArray->At(i));
+
       Double_t trackPoint[3];
-      
+      Double_t normVector[3];
+
       det->GetInitialPoint(trackPoint);
-      
-      bool ret = track->Intersect(trackPoint, det->NormVector(), b);
+      det->GetNormVector(normVector);
 
+      bool ret = track->Intersect(trackPoint, normVector, b);
+
+      if(ret)
+       {
+         if(det->IsInDetector(trackPoint)) return true;
+       }
     }
   return false;
 }
@@ -198,7 +208,6 @@ int AliHLTTriggerBarrelGeomMultiplicity::DoInit(int argc, const char** argv)
   if (iResult>=0 && argc>0)
     iResult=ConfigureFromArgumentString(argc, argv);
 
-  HLTWarning("TEST");
   return iResult;
 }
 
@@ -237,19 +246,19 @@ int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromCDBObject(const cha
 
              for(int i = 0; i < pArr->GetEntries(); i++)
                {
-                 if(!strcmp(pArr->At(i)->ClassName(), "AliHLTTriggerDecision"))
+                 if(!strcmp(pArr->At(i)->ClassName(), "AliHLTTriggerDecisionParameters"))
                    {
                      fTriggerDecisionPars = dynamic_cast<AliHLTTriggerDecisionParameters*>(pArr->At(i));
                    }
-                 else if(!strcmp(pArr->At(i)->ClassName(), "AliHLTTriggerDetectorGeom"))
+                 else if(pArr->At(i)->InheritsFrom("AliHLTTriggerDetectorGeom"))
                    {
                      fDetectorArray->AddLast(dynamic_cast<AliHLTTriggerDetectorGeom*>(pArr->At(i)));
                      nDetectorGeoms++;
-                     HLTWarning("received TObjArray of %d detector geometries", nDetectorGeoms);
+                     HLTWarning("received detector geometry of type %s", pArr->At(i)->ClassName());
                    }
                  else
                    {
-                     HLTWarning("Unknown object in configuration object");
+                     HLTWarning("Unknown object of type %s in configuration object", pArr->At(i)->ClassName());
                    }
                }
            } 
@@ -279,7 +288,6 @@ int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromFile(const char *fi
       
       if(geomfile)
        {
-         
          HLTInfo("configure from file \"%s\"", filename);
          TObjArray* pArr=dynamic_cast<TObjArray*>(geomfile->Get("GeomConf"));
          if (pArr) 
@@ -337,7 +345,7 @@ int AliHLTTriggerBarrelGeomMultiplicity::ScanConfigurationArgument(int argc, con
       return 2;
     }    
 
-  if (argument.CompareTo("-trgname")==0) 
+  if (argument.CompareTo("-triggername")==0) 
     {
       if (++i>=argc) return -EPROTO;
       
index caa510da84afaec557c45ea4c02380d10d8e8efd..6dc4b387ff401b65003433a3ea1c4b6b0249ec15 100644 (file)
@@ -11,7 +11,6 @@
 ///         a geometrical selection of the central barrel.
 
 #include "AliHLTTrigger.h"
-#include "TList.h"
 
 class AliHLTTriggerDecisionParameters;
 
@@ -20,7 +19,7 @@ class AliHLTTriggerDecisionParameters;
  * HLT trigger component for charged particle multiplicity in the
  * central barrel.
  * 
- * Triggers on charged particle number in a certain pt range.
+ * Triggers on charged particle number in a certain geometrical acceptance
  *
  * <h2>General properties:</h2>
  *
@@ -32,9 +31,13 @@ class AliHLTTriggerDecisionParameters;
  *
  * <h2>Mandatory arguments:</h2>
  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li -triggername     <i> n   </i> <br>
+ *      specifies which configuration object to use for the trigger
  *
  * <h2>Optional arguments:</h2>
  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li -geomfile     <i> n   </i> <br>
+ *      specifies root file containing configuration objects
  *
  * <h2>Configuration:</h2>
  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
@@ -47,7 +50,8 @@ class AliHLTTriggerDecisionParameters;
  * component arguments.
  *
  * <h2>Default CDB entries:</h2>
- * HLT/ConfigHLT/BarrelGeomMultiplicityTrigger: TList storing the detector geometries
+ * HLT/ConfigHLT/BarrelGeomMultiplicityTrigger/<triggername>: TObjArray storing the
+ * geometries and readout parameters. 
  * HLT/ConfigHLT/Solenoidbz: TObjString -solenoidBz field
  *
  * <h2>Performance:</h2>
@@ -125,7 +129,7 @@ class AliHLTTriggerBarrelGeomMultiplicity : public AliHLTTrigger
   // The trigger name
   char *fTriggerName; //!transient
   
-  /// the default configuration entry for this component
+  // the default configuration entry for this component
   char* fOCDBEntry; //!transient
 
 
index cc12551d824ecc437fa74247714a9cdfa26c6787..cd1e4c59d02738838516ccb1133c198b51142cb5 100644 (file)
@@ -34,7 +34,6 @@
 #include "AliHLTGlobalBarrelTrack.h"
 #include "TObjArray.h"
 #include "TObjString.h"
-#include "TVector3.h"
 
 /** ROOT macro for the implementation of ROOT specific class methods */
 ClassImp(AliHLTTriggerBarrelMultiplicity)
index 2d4ff38168791377ac0da5cb3373f4ff2d039b2d..0e0fd864ad372ca787183c48722bd9839e52fbdf 100644 (file)
@@ -46,8 +46,6 @@ public:
   /** Get the description */
   TString GetDescription() { return fDescription; }
 
-  
-
 private:
   
   /** The trigger name */
index 4afe6253c87d6f00fe7a487aa9e1b8536a963a7f..48f69628520736a1de2eaea5b30906c0b1bcb6ae 100644 (file)
@@ -18,7 +18,7 @@
 /// @author Oystein Djuvsland
 /// @date   2009-10-08
 /// @brief  HLT class describing simple geometry of (sub-)detectors.
-///         Used for the AliHLTTriggerBarrelGeomMultiplicity classes
+///         Used for the AliHLTTriggerBarrelGeomMultiplicity class
 
 // see header file for class documentation
 // or
 
 #include "AliHLTTriggerDetectorGeom.h"
 #include <ostream>
+
 /** ROOT macro for the implementation of ROOT specific class methods */
 ClassImp(AliHLTTriggerDetectorGeom)
 
-AliHLTTriggerDetectorGeom::AliHLTTriggerDetectorGeom() 
+AliHLTTriggerDetectorGeom::AliHLTTriggerDetectorGeom()
 : TObject(),
   fEtaMin(0),
   fEtaMax(0),
@@ -72,14 +73,26 @@ void AliHLTTriggerDetectorGeom::SetNormVector(Double_t *nVector)
 
 void AliHLTTriggerDetectorGeom::GetInitialPoint(Double_t *point)
 {
+  // See header file for class documentation
   for(int i = 0; i < 3; i++)
     {
       point[i] = fInitalPoint[i];
     }
 }
 
+void AliHLTTriggerDetectorGeom::GetNormVector(Double_t *vec)
+{
+  // See header file for class documentation
+  for(int i = 0; i < 3; i++)
+    {
+      vec[i] = fNormVector[i];
+    }
+}
+
 void AliHLTTriggerDetectorGeom::PrintDetectorGeom(std::ostream &out)
 {
+  // See header file for class documentation
+
   out << "Name: " << fName << std::endl;
   out << "Eta Min: " << fEtaMin << std::endl;
   out << "Eta Max: " << fEtaMax << std::endl;
index 522bbf64d6575bf12284baedeb509ef2edbf63cf..a83fadf3f3562d30dd8835f5294644741d33d0e4 100644 (file)
 /// @brief  HLT class describing simple geometry of (sub-)detectors.
 ///         Used for the AliHLTTriggerBarrelGeomMultiplicity classes
 
-#include "TObject.h"
 #include "TString.h"
 #include <ostream>
+#include "TObject.h"
 
 /**
  * @class  AliHLTTriggerDetectorGeom
  * HLT class describing simple geometry cuts of (sub-)detectors.
- * Used for the AliHLTTriggerBarrelGeomMultiplicity classes
+ * Used for the AliHLTTriggerBarrelGeomMultiplicity class
  *
  * \ingroup alihlt_trigger
  */
@@ -75,18 +75,50 @@ public:
    */
   void SetDetName(TString &name) { fName = name; } // Set name
 
+  /** 
+   * Get the minimum in eta (should be moved...)
+   */
   Double_t EtaMin() { return fEtaMin; }
+
+  /** 
+   * Get the maximum in eta (should be moved...)
+   */
   Double_t EtaMax() { return fEtaMax; }
+
+  /** 
+   * Get the minimum in phi (should be moved...)
+   */
   Double_t PhiMin() { return fPhiMin; }
+
+  /** 
+   * Get the maximum in phi (should be moved...)
+   */
   Double_t PhiMax() { return fPhiMax; }
 
+  /** 
+   * Get the initial point
+   */
   void GetInitialPoint(Double_t *point);
-  Double_t* NormVector() { return fNormVector; }
+
+  /**
+   * Get the normal vector
+   */
+  void GetNormVector(Double_t *vec);
   
+  /** 
+   * Get the detector name
+   */
   TString DetName() { return fName; }
 
+  /** 
+   * Print the geometry
+   */
   void PrintDetectorGeom(std::ostream &out);
 
+  /** 
+   * Abstract method to check if a point is in the 
+   * acceptance of the geometry 
+   */
   virtual Bool_t IsInDetector(Double_t point[3]) = 0;
 
 protected:
index 31261d051a1e7f8a9eaf83b1f024714383aa3fee..322eb3652a9c836585627cf9239edab460f8d466 100644 (file)
@@ -30,6 +30,7 @@
 #include "AliHLTTriggerDetectorGeomRectangle.h"
 #include "AliHLTTriggerDetectorGeom.h"
 #include "TVector3.h"
+#include "TMath.h"
 
 
 AliHLTTriggerDetectorGeomRectangle::AliHLTTriggerDetectorGeomRectangle() : AliHLTTriggerDetectorGeom()
@@ -47,13 +48,23 @@ Bool_t AliHLTTriggerDetectorGeomRectangle::IsInDetector(Double_t point[3])
   // See header file for class documentation
   TVector3 trackPos(point);
   
+
+  Double_t phi = 0;
+
+  if(trackPos.Phi() < 0) phi = trackPos.Phi() + 2*TMath::Pi();
+  else phi = trackPos.Phi();
+
   if(trackPos.Eta() >= fEtaMin && 
      trackPos.Eta() <= fEtaMax &&
-     trackPos.Phi() >= fPhiMin &&
-     trackPos.Phi() <= fPhiMax)
+     phi >= fPhiMin &&
+     phi <= fPhiMax)
     {
+      //      printf("Checking point: Eta: %f Phi: %f against cuts EtaMin: %f EtaMax: %f PhiMin: %f PhiMax: %f - true\n", trackPos.Eta(), phi, fEtaMin, fEtaMax, fPhiMin, fPhiMax);
       return true;
     }
+
+  //  printf("Checking point: Eta: %f Phi: %f against cuts EtaMin: %f EtaMax: %f PhiMin: %f PhiMax: %f - false\n", trackPos.Eta(), phi, fEtaMin, fEtaMax, fPhiMin, fPhiMax);
+
   return false;
 }
 
index 450c28605c5a666b5a7739735e629d403f7fe239..5fa97f56892638cd0ba0385900b1b3dd19772162 100644 (file)
@@ -11,6 +11,9 @@
 /// @brief  HLT class describing simple rectangular geometry of (sub-)detectors.
 ///         Used for the AliHLTTriggerBarrelGeomMultiplicity classes
 
+#include "AliHLTTriggerDetectorGeom.h"
+
+
 /**
  * @class  AliHLTTriggerDetectorGeomRectangle
  * HLT class describing simple rectangular geometry cuts of (sub-)detectors.
  * \ingroup alihlt_trigger
  */
 
-#include "AliHLTTriggerDetectorGeom.h"
-
-
 class AliHLTTriggerDetectorGeomRectangle : public AliHLTTriggerDetectorGeom
 {
 public: 
 
+  /** Default constructor */
   AliHLTTriggerDetectorGeomRectangle();
+  
+  /** Default destructor */
   virtual ~AliHLTTriggerDetectorGeomRectangle();
 
   /**