- adding AliHLTTriggerDecisionParameters to configure the geom trigger from OCDB.
authorodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 11:24:51 +0000 (11:24 +0000)
committerodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 11:24:51 +0000 (11:24 +0000)
- adding subclass for checking rectangular geometries
- modifications to facilitate for the above.

13 files changed:
HLT/libAliHLTTrigger.pkg
HLT/trigger/AliHLTTriggerAgent.cxx
HLT/trigger/AliHLTTriggerBarrelGeomMultiplicity.cxx
HLT/trigger/AliHLTTriggerBarrelGeomMultiplicity.h
HLT/trigger/AliHLTTriggerBarrelMultiplicity.cxx
HLT/trigger/AliHLTTriggerBarrelMultiplicity.h
HLT/trigger/AliHLTTriggerDecisionParameters.cxx [new file with mode: 0644]
HLT/trigger/AliHLTTriggerDecisionParameters.h [new file with mode: 0644]
HLT/trigger/AliHLTTriggerDetectorGeom.cxx
HLT/trigger/AliHLTTriggerDetectorGeom.h
HLT/trigger/AliHLTTriggerDetectorGeomRectangle.cxx [new file with mode: 0644]
HLT/trigger/AliHLTTriggerDetectorGeomRectangle.h [new file with mode: 0644]
HLT/trigger/AliHLTTriggerLinkDef.h

index 5a4b171..d99385b 100644 (file)
@@ -26,7 +26,9 @@ CLASS_HDRS:= \
                AliHLTTriggerPhosMip.h                      \
                AliHLTTriggerTrdClusterMultiplicity.h       \
                AliHLTTriggerBarrelGeomMultiplicity.h       \
-               AliHLTTriggerDetectorGeom.h
+               AliHLTTriggerDetectorGeom.h                 \
+               AliHLTTriggerDetectorGeomRectangle.h        \
+               AliHLTTriggerDecisionParameters.h
 
 
 # library sources
index 4a8acd1..bf8ce77 100644 (file)
@@ -36,6 +36,7 @@
 #include "AliHLTEventSummaryProducerComponent.h"
 #include "AliHLTRunSummaryProducerComponent.h"
 #include "AliHLTTriggerBarrelMultiplicity.h"
+#include "AliHLTTriggerBarrelGeomMultiplicity.h"
 #include "AliHLTTriggerBarrelCosmic.h"
 #include "AliHLTGlobalTriggerComponent.h"
 #include "AliHLTTriggerPhosClusterEnergy.h"
@@ -71,6 +72,7 @@ int AliHLTTriggerAgent::RegisterComponents(AliHLTComponentHandler* pHandler) con
   if (!pHandler) return -EINVAL;
   pHandler->AddComponent(new AliHLTGlobalTriggerComponent);
   pHandler->AddComponent(new AliHLTTriggerBarrelMultiplicity);
+  pHandler->AddComponent(new AliHLTTriggerBarrelGeomMultiplicity);
   pHandler->AddComponent(new AliHLTTriggerBarrelCosmic);
   pHandler->AddComponent(new AliHLTTriggerPhosClusterEnergy); 
   pHandler->AddComponent(new AliHLTTriggerPhosMip); 
index 5e9ddee..9200bb3 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "AliHLTTriggerBarrelGeomMultiplicity.h"
 #include "AliHLTTriggerDetectorGeom.h"
+#include "AliHLTTriggerDecisionParameters.h"
 #include "AliESDEvent.h"
 #include "AliHLTTriggerDecision.h"
 #include "AliHLTDomainEntry.h"
@@ -47,7 +48,7 @@ ClassImp(AliHLTTriggerBarrelGeomMultiplicity)
 AliHLTTriggerBarrelGeomMultiplicity::AliHLTTriggerBarrelGeomMultiplicity()
   : AliHLTTrigger()
   , fSolenoidBz(0)
-  , fMinTracks(0)
+  , fMinTracks(1)
   , fDetectorArray(0)
 {
   // see header file for class documentation
@@ -55,6 +56,7 @@ AliHLTTriggerBarrelGeomMultiplicity::AliHLTTriggerBarrelGeomMultiplicity()
   // refer to README to build package
   // or
   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+  fDetectorArray = new TObjArray(1);
 
 }
 
@@ -66,8 +68,8 @@ AliHLTTriggerBarrelGeomMultiplicity::~AliHLTTriggerBarrelGeomMultiplicity()
 const char* AliHLTTriggerBarrelGeomMultiplicity::GetTriggerName() const 
 {
   // see header file for class documentation
-  const char* name = fTriggerName;
-  if(name) return name;
+  //  const char* name = fTriggerName;
+  //  if(name) return name;
   return "BarrelGeomMultiplicityTrigger";
 }
 
@@ -139,10 +141,16 @@ int AliHLTTriggerBarrelGeomMultiplicity::DoTrigger()
     }
   if (numberOfTracks>=fMinTracks) 
     {
-      description.Form("Event contains %d track(s) satisfying geometrical cut", numberOfTracks);
-      SetDescription(description);
 
-      TriggerEvent(fTriggerDecision);
+      SetDescription(fTriggerDecisionPars->GetDescription());
+      AliHLTReadoutList readout(fTriggerDecisionPars->GetReadoutListParameter());
+      AliHLTTriggerDecision decision(
+                                    true,
+                                    fTriggerDecisionPars->GetTriggerName().Data(),
+                                    AliHLTTriggerDomain(readout),
+                                    fTriggerDecisionPars->GetDescription()
+                                    );
+      TriggerEvent(&decision);
     }
   
   return iResult;
@@ -176,15 +184,6 @@ bool AliHLTTriggerBarrelGeomMultiplicity::IsInDetectors(T* track, float b)
       
       bool ret = track->Intersect(trackPoint, det->NormVector(), b);
 
-      TVector3 trackPos(trackPoint);
-      
-      if(trackPos.Eta() >= det->EtaMin() && 
-        trackPos.Eta() <= det->EtaMax() &&
-        trackPos.Phi() >= det->PhiMin() &&
-        trackPos.Phi() <= det->PhiMax())
-       {
-         return true;
-       }
     }
   return false;
 }
@@ -199,7 +198,7 @@ int AliHLTTriggerBarrelGeomMultiplicity::DoInit(int argc, const char** argv)
   if (iResult>=0 && argc>0)
     iResult=ConfigureFromArgumentString(argc, argv);
 
-
+  HLTWarning("TEST");
   return iResult;
 }
 
@@ -240,13 +239,13 @@ int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromCDBObject(const cha
                {
                  if(!strcmp(pArr->At(i)->ClassName(), "AliHLTTriggerDecision"))
                    {
-                     fTriggerDecision = dynamic_cast<AliHLTTriggerDecision*>(pArr->At(i));
+                     fTriggerDecisionPars = dynamic_cast<AliHLTTriggerDecisionParameters*>(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);
+                     HLTWarning("received TObjArray of %d detector geometries", nDetectorGeoms);
                    }
                  else
                    {
@@ -282,25 +281,25 @@ int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromFile(const char *fi
        {
          
          HLTInfo("configure from file \"%s\"", filename);
-         TObjArray* pArr=dynamic_cast<TObjArray*>(geomfile->Get("GeomConfig"));
+         TObjArray* pArr=dynamic_cast<TObjArray*>(geomfile->Get("GeomConf"));
          if (pArr) 
            {
 
              for(int i = 0; i < pArr->GetEntries(); i++)
                {
-                 if(!strcmp(pArr->At(i)->ClassName(), "AliHLTTriggerDecision"))
+                 if(!strcmp(pArr->At(i)->ClassName(), "AliHLTTriggerDecisionParameters"))
                    {
-                     fTriggerDecision = dynamic_cast<AliHLTTriggerDecision*>(pArr->At(i));
+                     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++;
-                     HLTInfo("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());
                    }
                }
            } 
@@ -312,10 +311,12 @@ int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromFile(const char *fi
          } 
       else 
        {
-         HLTError("can not open file \"%s\"", filename);
+         HLTError("could not open file \"%s\"", filename);
          nDetectorGeoms=-ENOENT;
        }
     }
+  HLTWarning("received TObjArray with %d detector geometries", nDetectorGeoms);
+
   return nDetectorGeoms;
 }
 
@@ -336,7 +337,7 @@ int AliHLTTriggerBarrelGeomMultiplicity::ScanConfigurationArgument(int argc, con
       return 2;
     }    
 
-  if (argument.CompareTo("-triggername")==0) 
+  if (argument.CompareTo("-trgname")==0) 
     {
       if (++i>=argc) return -EPROTO;
       
index f546a7f..caa510d 100644 (file)
@@ -12,6 +12,9 @@
 
 #include "AliHLTTrigger.h"
 #include "TList.h"
+
+class AliHLTTriggerDecisionParameters;
+
 /**
  * @class  AliHLTTriggerBarrelGeomMultiplicity
  * HLT trigger component for charged particle multiplicity in the
@@ -116,8 +119,8 @@ class AliHLTTriggerBarrelGeomMultiplicity : public AliHLTTrigger
   // array of (sub-)detectors to trigger on
   TObjArray *fDetectorArray; // !transient
 
-  // Trigger decision
-  AliHLTTriggerDecision *fTriggerDecision; //!transient
+  // Trigger decision parameters
+  AliHLTTriggerDecisionParameters *fTriggerDecisionPars; //!transient
 
   // The trigger name
   char *fTriggerName; //!transient
index cd1e4c5..cc12551 100644 (file)
@@ -34,6 +34,7 @@
 #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 0074406..da71e16 100644 (file)
@@ -105,6 +105,7 @@ class AliHLTTriggerBarrelMultiplicity : public AliHLTTrigger
   int ScanConfigurationArgument(int argc, const char** argv);
 
  private:
+
   /// inherited from AliHLTTrigger: calculate the trigger
   virtual int DoTrigger();
 
diff --git a/HLT/trigger/AliHLTTriggerDecisionParameters.cxx b/HLT/trigger/AliHLTTriggerDecisionParameters.cxx
new file mode 100644 (file)
index 0000000..971f533
--- /dev/null
@@ -0,0 +1,26 @@
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//*                                                                        *
+//* Primary Authors: Oystein Djuvsland                                     *
+//*                  for The ALICE HLT Project.                            *
+//*                                                                        *
+//* Permission to use, copy, modify and distribute this software and its   *
+//* documentation strictly for non-commercial purposes is hereby granted   *
+//* without fee, provided that the above copyright notice appears in all   *
+//* copies and that both the copyright notice and this permission notice   *
+//* appear in the supporting documentation. The authors make no claims     *
+//* about the suitability of this software for any purpose. It is          *
+//* provided "as is" without express or implied warranty.                  *
+//**************************************************************************
+
+#include "AliHLTTriggerDecisionParameters.h"
+AliHLTTriggerDecisionParameters::AliHLTTriggerDecisionParameters()
+{
+  // See header file for class documentation
+}
+
+AliHLTTriggerDecisionParameters::~AliHLTTriggerDecisionParameters()
+{
+  // See header file for class documentation
+}
diff --git a/HLT/trigger/AliHLTTriggerDecisionParameters.h b/HLT/trigger/AliHLTTriggerDecisionParameters.h
new file mode 100644 (file)
index 0000000..2d4ff38
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef ALIHLTTRIGGERDECISIONPARAMETERS_H
+#define ALIHLTTRIGGERDECISIONPARAMETERS_H
+
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//* See cxx source for full Copyright notice                               *
+
+/// @file   AliHLTTriggerDecisionParameters.h
+/// @author Oystein Djuvsland
+/// @date   2009-10-08
+/// @brief  HLT class describing simple geometry of (sub-)detectors.
+///         Used for the AliHLTTriggerBarrelGeomMultiplicity classes
+
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "TObject.h"
+#include "TString.h"
+
+class AliHLTTriggerDecisionParameters : public TObject
+{
+public: 
+  
+  /** Default constructor */
+  AliHLTTriggerDecisionParameters();
+
+  /** Destructor */
+  virtual ~AliHLTTriggerDecisionParameters();
+
+  /** Get the trigger name */
+  void SetTriggerName(TString name) { fTriggerName = name; }
+
+  /** Get the readout list parameter */
+  void SetReadoutListParameter(UInt_t par) { fReadoutListParameter = par; }
+
+  /** Get the description */
+  void SetDescription(TString descr) { fDescription = descr; }
+
+  /** Get the trigger name */
+  TString GetTriggerName() { return fTriggerName; }
+
+  /** Get the readout list parameter */
+  UInt_t GetReadoutListParameter() { return fReadoutListParameter; }
+
+  /** Get the description */
+  TString GetDescription() { return fDescription; }
+
+  
+
+private:
+  
+  /** The trigger name */
+  TString fTriggerName;
+
+  /** Basically the argument to the AliHLTReadoutList constructor */
+  UInt_t fReadoutListParameter;
+  
+  /** Description of the trigger */
+  TString fDescription;
+
+  ClassDef(AliHLTTriggerDecisionParameters, 1);
+};
+
+#endif
index 78f1d01..4afe625 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   *
@@ -85,6 +85,7 @@ void AliHLTTriggerDetectorGeom::PrintDetectorGeom(std::ostream &out)
   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; 
+  out << "Initial Point: {" << fInitalPoint[0] << ", " << fInitalPoint[1] << ", " << fInitalPoint[2] << "}" << std::endl; 
+  out << "Normal Vector: {" << fNormVector[0] << ", " << fNormVector[1] << ", " << fNormVector[2] << "}" << std::endl; 
 }
+
index 1f42140..522bbf6 100644 (file)
@@ -87,7 +87,9 @@ public:
 
   void PrintDetectorGeom(std::ostream &out);
 
-private:
+  virtual Bool_t IsInDetector(Double_t point[3]) = 0;
+
+protected:
 
   /** The minimum in eta */
   Double_t fEtaMin;   // The minimum in eta 
@@ -100,7 +102,11 @@ private:
 
   /** The maximum in phi */
   Double_t fPhiMax;   // The maximum in phi 
+
+  /** Name of the (sub-)detector */
+  TString fName;      // Name of the (sub-)detector 
   
+private: 
   /** 
    * The point which together with a normal vector 
    * defines the plane of the (sub-)detector
@@ -113,8 +119,6 @@ private:
    */
   Double_t fNormVector[3]; // Normal vector representing the plane
 
-  /** Name of the (sub-)detector */
-  TString fName;      // Name of the (sub-)detector 
   
   ClassDef(AliHLTTriggerDetectorGeom, 1);
 
diff --git a/HLT/trigger/AliHLTTriggerDetectorGeomRectangle.cxx b/HLT/trigger/AliHLTTriggerDetectorGeomRectangle.cxx
new file mode 100644 (file)
index 0000000..31261d0
--- /dev/null
@@ -0,0 +1,59 @@
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//*                                                                        *
+//* Primary Authors: Oystein Djuvsland                                     *
+//*                  for The ALICE HLT Project.                            *
+//*                                                                        *
+//* Permission to use, copy, modify and distribute this software and its   *
+//* documentation strictly for non-commercial purposes is hereby granted   *
+//* without fee, provided that the above copyright notice appears in all   *
+//* copies and that both the copyright notice and this permission notice   *
+//* appear in the supporting documentation. The authors make no claims     *
+//* about the suitability of this software for any purpose. It is          *
+//* provided "as is" without express or implied warranty.                  *
+//**************************************************************************
+
+/// @file   AliHLTTriggerDetectorGeomRectangle.cxx
+/// @author Oystein Djuvsland
+/// @date   2009-10-08
+/// @brief  HLT class describing simple rectangular geometry of (sub-)detectors.
+///         Used for the AliHLTTriggerBarrelGeomMultiplicity classes
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTTriggerDetectorGeomRectangle.h"
+#include "AliHLTTriggerDetectorGeom.h"
+#include "TVector3.h"
+
+
+AliHLTTriggerDetectorGeomRectangle::AliHLTTriggerDetectorGeomRectangle() : AliHLTTriggerDetectorGeom()
+{
+  // See header file for class documentation
+}
+
+AliHLTTriggerDetectorGeomRectangle::~AliHLTTriggerDetectorGeomRectangle()
+{
+  // See header file for class documentation
+}
+
+Bool_t AliHLTTriggerDetectorGeomRectangle::IsInDetector(Double_t point[3])
+{
+  // See header file for class documentation
+  TVector3 trackPos(point);
+  
+  if(trackPos.Eta() >= fEtaMin && 
+     trackPos.Eta() <= fEtaMax &&
+     trackPos.Phi() >= fPhiMin &&
+     trackPos.Phi() <= fPhiMax)
+    {
+      return true;
+    }
+  return false;
+}
+
diff --git a/HLT/trigger/AliHLTTriggerDetectorGeomRectangle.h b/HLT/trigger/AliHLTTriggerDetectorGeomRectangle.h
new file mode 100644 (file)
index 0000000..450c286
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef ALIHLTTRIGGERDETECTORGEOMRECTANGLE_H
+#define ALIHLTTRIGGERDETECTORGEOMRECTANGLE_H
+
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//* See cxx source for full Copyright notice                               *
+
+/// @file   AliHLTTriggerDetectorGeomRectangle.h
+/// @author Oystein Djuvsland
+/// @date   2009-10-08
+/// @brief  HLT class describing simple rectangular geometry of (sub-)detectors.
+///         Used for the AliHLTTriggerBarrelGeomMultiplicity classes
+
+/**
+ * @class  AliHLTTriggerDetectorGeomRectangle
+ * HLT class describing simple rectangular geometry cuts of (sub-)detectors.
+ * Used for the AliHLTTriggerBarrelGeomMultiplicity classes
+ *
+ * \ingroup alihlt_trigger
+ */
+
+#include "AliHLTTriggerDetectorGeom.h"
+
+
+class AliHLTTriggerDetectorGeomRectangle : public AliHLTTriggerDetectorGeom
+{
+public: 
+
+  AliHLTTriggerDetectorGeomRectangle();
+  virtual ~AliHLTTriggerDetectorGeomRectangle();
+
+  /**
+   * Check if a point is in the detector geometry. 
+   * @param point is the point in global coordinates (cm)
+   * @return true if the point is in the geometry
+   */
+  Bool_t IsInDetector(Double_t point[3]);
+  
+  ClassDef(AliHLTTriggerDetectorGeomRectangle, 1);
+};
+
+#endif
index 99ea5e3..bd5f8b6 100644 (file)
@@ -9,6 +9,7 @@
 #pragma link C++ class AliHLTGlobalTriggerConfig+;
 #pragma link C++ class AliHLTGlobalTriggerComponent+;
 #pragma link C++ class AliHLTTriggerBarrelMultiplicity+;
+#pragma link C++ class AliHLTTriggerBarrelGeomMultiplicity+;
 #pragma link C++ class AliHLTTriggerBarrelCosmic+;
 #pragma link C++ class AliHLTTriggerAgent+;
 #pragma link C++ class AliHLTEventSummary+;
@@ -20,4 +21,7 @@
 #pragma link C++ class AliHLTTriggerPhosClusterEnergy+;
 #pragma link C++ class AliHLTTriggerPhosMip+;
 #pragma link C++ class AliHLTTriggerTrdClusterMultiplicity+;
+#pragma link C++ class AliHLTTriggerDetectorGeom+;
+#pragma link C++ class AliHLTTriggerDetectorGeomRectangle+;
+#pragma link C++ class AliHLTTriggerDecisionParameters+;
 #endif