]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding Mimimum Ionizing Particle trigger for PHOS inclduing configuration object...
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Aug 2009 11:30:45 +0000 (11:30 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Aug 2009 11:30:45 +0000 (11:30 +0000)
HLT/CMake_libAliHLTTrigger.txt
HLT/libAliHLTTrigger.pkg
HLT/trigger/AliHLTTriggerAgent.cxx
HLT/trigger/AliHLTTriggerLinkDef.h
HLT/trigger/AliHLTTriggerPhosMip.cxx [new file with mode: 0644]
HLT/trigger/AliHLTTriggerPhosMip.h [new file with mode: 0644]
OCDB/HLT/ConfigHLT/PhosMipTrigger/Run0_999999999_v0_s0.root [new file with mode: 0644]

index 732e2a6b6d670279db6bbc4ef6e2fe1e89a1cf6e..2768a50dddb8beb7f7b112e377c92e9b9005c727 100644 (file)
@@ -15,6 +15,7 @@ trigger/AliHLTRunSummaryProducerComponent.cxx
 trigger/AliHLTTriggerSelectiveReadoutComponent.cxx
 trigger/AliHLTTriggerMonitoringComponent.cxx
 trigger/AliHLTTriggerPhosClusterEnergy.cxx
+trigger/AliHLTTriggerPhosMip.cxx
 )
 
 # fill list of header files from list of source files
index 3f67b703da9233f689f3f02e7f45fab90f634966..be1a7eadc6e2c2849c6c02669c6b70f54742a5d4 100644 (file)
@@ -22,7 +22,8 @@ CLASS_HDRS:= \
                 AliHLTRunSummaryProducerComponent.h         \
                 AliHLTTriggerSelectiveReadoutComponent.h    \
                 AliHLTTriggerMonitoringComponent.h          \
-               AliHLTTriggerPhosClusterEnergy.h            
+               AliHLTTriggerPhosClusterEnergy.h            \
+               AliHLTTriggerPhosMip.h            
 
 
 # library sources
index c35972025bfdee42d0d0b2cf7eb13cda761f6e7f..205226f019b566cefaff595b482a750bec62f089 100644 (file)
@@ -39,6 +39,7 @@
 #include "AliHLTTriggerBarrelCosmic.h"
 #include "AliHLTGlobalTriggerComponent.h"
 #include "AliHLTTriggerPhosClusterEnergy.h"
+#include "AliHLTTriggerPhosMip.h"
 
 /** global instance for agent registration */
 AliHLTTriggerAgent gAliHLTTriggerAgent;
@@ -71,6 +72,7 @@ int AliHLTTriggerAgent::RegisterComponents(AliHLTComponentHandler* pHandler) con
   pHandler->AddComponent(new AliHLTTriggerBarrelMultiplicity);
   pHandler->AddComponent(new AliHLTTriggerBarrelCosmic);
   pHandler->AddComponent(new AliHLTTriggerPhosClusterEnergy); 
+  pHandler->AddComponent(new AliHLTTriggerPhosMip); 
   return 0;
 }
 
index 0fc9a35d12ab7a23f1e98c5465c96fbbca558eb8..652c2d48e6e24d2c75f7436be4e944b0701701b5 100644 (file)
@@ -17,4 +17,5 @@
 #pragma link C++ class AliHLTTriggerSelectiveReadoutComponent+;
 #pragma link C++ class AliHLTTriggerMonitoringComponent+;
 #pragma link C++ class AliHLTTriggerPhosClusterEnergy+;
+#pragma link C++ class AliHLTTriggerPhosMip+;
 #endif
diff --git a/HLT/trigger/AliHLTTriggerPhosMip.cxx b/HLT/trigger/AliHLTTriggerPhosMip.cxx
new file mode 100644 (file)
index 0000000..38584dd
--- /dev/null
@@ -0,0 +1,194 @@
+// $Id$
+//-*- Mode: C++ -*-
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//*                                                                        *
+//* Primary Authors: Svein Lindal <svein.lindal@fys.uio.no>                 *
+//*                  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   AliHLTTriggerPhosMip.cxx
+/// @author Svein Lindal
+/// @date   2009-08-19
+/// @brief  HLT Minimum Ionizing Particle (MIP) trigger for PHOS
+
+// 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 "AliHLTTriggerPhosMip.h"
+#include "AliESDEvent.h"
+#include "AliESDCaloCluster.h"
+#include "AliHLTTriggerDecision.h"
+#include "AliHLTDomainEntry.h"
+
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTTriggerPhosMip)
+
+AliHLTTriggerPhosMip::AliHLTTriggerPhosMip() 
+  : AliHLTTrigger()
+  , fEMin(0.0)
+  , fEMax(0.0)
+  , fNCellsMax(0)
+{
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlts
+}
+
+const char* AliHLTTriggerPhosMip::fgkOCDBEntry="HLT/ConfigHLT/PhosMipTrigger";
+
+AliHLTTriggerPhosMip::~AliHLTTriggerPhosMip()
+{
+  // see header file for class documentation
+}
+
+const char* AliHLTTriggerPhosMip::GetTriggerName() const
+{
+  // see header file for class documentation
+  return "PhosMipTrigger";
+}
+
+AliHLTComponent* AliHLTTriggerPhosMip::Spawn()
+{
+  // see header file for class documentation
+  return new AliHLTTriggerPhosMip;
+}
+
+int AliHLTTriggerPhosMip::DoTrigger()
+{
+  // see header file for class documentation
+
+  TString description;
+
+  const TObject* obj = GetFirstInputObject(kAliHLTAllDataTypes, "AliESDEvent");
+  AliESDEvent* esd = dynamic_cast<AliESDEvent*>(const_cast<TObject*>(obj));
+  
+  if (esd != NULL) {
+    esd->GetStdContent();
+    
+    //Loop over Calorimeter clusters
+    Int_t ncc = esd->GetNumberOfCaloClusters();
+    for (Int_t i = 0; i < ncc ; i++) {
+      AliESDCaloCluster * cluster = esd->GetCaloCluster(i);
+      
+      // Trigger condition: PHOS clusters within energy range, cells < fNCellsMax
+      if ( cluster->IsPHOS() && 
+          cluster->E() > fEMin && 
+          cluster->E() < fEMax && 
+          cluster->GetNCells() <= fNCellsMax ) {
+         
+       description.Form("Event contains at least one PHOS cluster satisfying MIP criteria");
+       SetDescription(description.Data());
+       
+       // Enable the detectors for readout.
+       GetReadoutList().Enable( AliHLTReadoutList::kPHOS );
+       
+       // Add the available HLT information for readout too.
+       GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "PHOS");
+       
+       //Set trigger decision
+       TriggerEvent(true);
+       
+       return 0;
+      } /// if trigger criteria
+    }  /// cluster loop
+  }
+  
+  // If we got to this point then we did not find any good MIP candidates
+  // generate negative trigger decision
+  description.Form("No PHOS clusters satisfying MIP criteria found");
+  SetDescription(description.Data());
+  TriggerEvent(false);
+  return 0;
+}
+
+int AliHLTTriggerPhosMip::DoInit(int argc, const char** argv) {
+  // see header file for class documentation
+
+  // first configure the default
+  int iResult=ConfigureFromCDBTObjString(fgkOCDBEntry);
+
+  // configure from the command line parameters if specified
+  if (iResult>=0 && argc>0) {
+    HLTInfo("Trigger configuration from OCDB database entry:  emin %.03f GeV \n emax %.03f, \n ncells: %i", fEMin, fEMax, fNCellsMax ); 
+    iResult=ConfigureFromArgumentString(argc, argv);
+    HLTInfo("Trigger configuration overwritten from command line:  emin %.03f GeV \n emax %.03f, \n ncells: %i", fEMin, fEMax, fNCellsMax ); 
+   } else if ( iResult >=0 ) {
+    HLTInfo("Trigger configuration from OCDB database entry:  emin %.03f GeV \n emax %.03f, \n ncells: %i", fEMin, fEMax, fNCellsMax ); 
+  }
+  return iResult;
+}
+
+int AliHLTTriggerPhosMip::DoDeinit()
+{
+  // see header file for class documentation
+  return 0;
+}
+
+int AliHLTTriggerPhosMip::Reconfigure(const char* cdbEntry, const char* /*chainId*/)
+{
+  // see header file for class documentation
+
+  // configure from the specified antry or the default one
+  const char* entry=cdbEntry;
+  if (!entry || entry[0]==0) entry=fgkOCDBEntry;
+
+  return ConfigureFromCDBTObjString(entry);
+}
+
+int AliHLTTriggerPhosMip::ScanConfigurationArgument(int argc, const char** argv)
+{
+  // see header file for class documentation
+  if (argc<=0) return 0;
+  int i=0;
+  TString argument=argv[i];
+
+  // -mine
+  if (argument.CompareTo("-emin")==0) {
+    if (++i>=argc) return -EPROTO;
+    argument=argv[i];
+    fEMin=argument.Atof();
+    return 2;
+  }    
+
+  ///-maxe
+  else if (argument.CompareTo("-emax")==0) {
+    if (++i>=argc) return -EPROTO;
+    argument=argv[i];
+    fEMax=argument.Atof();
+    return 2;
+  }    
+
+  ///-ncells
+  else if (argument.CompareTo("-ncells")==0) {
+    if (++i>=argc) return -EPROTO;
+    argument=argv[i];
+    fNCellsMax=argument.Atof();
+    return 2;
+  }    
+  
+  // unknown argument
+  return -EINVAL;
+}
+
+void AliHLTTriggerPhosMip::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
+{
+  // see header file for class documentation
+  constBase = sizeof(AliHLTTriggerDecision) + sizeof(AliHLTDomainEntry)*14;
+  inputMultiplier = 1;
+}
diff --git a/HLT/trigger/AliHLTTriggerPhosMip.h b/HLT/trigger/AliHLTTriggerPhosMip.h
new file mode 100644 (file)
index 0000000..df0fd5c
--- /dev/null
@@ -0,0 +1,115 @@
+// $Id$
+//-*- Mode: C++ -*-
+#ifndef ALIHLTTRIGGERPHOSMIP_H
+#define ALIHLTTRIGGERPHOSMIP_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   AliHLTTriggerPhosMip.h
+/// @author Svein Lindal
+/// @date   2009-08-17
+/// @brief  HLT Minimum Ionizing Particle (MIP) trigger for PHOS
+
+#include "AliHLTTrigger.h"
+
+
+class AliESDtrack;
+
+/**
+ * @class  AliHLTTriggerPhosMip
+ * HLT trigger component for Minimum Ionizing Particles (MIPs) in PHOS.
+ * 
+ * Triggers on PHOS clusters containing total energy in the range
+ * fEMin < energy < fEMax spread out between fewer than fNCellsMax cells.
+ *
+ * <h2>General properties:</h2>
+ *
+ * Component ID: \b PhosMipTrigger                             <br>
+ * Library: \b libAliHLTTrigger.so                                        <br>
+ * Input Data Types:  kAliHLTDataTypeESDObject, kAliHLTDataTypeESDTree    <br>
+ * Output Data Types: ::kAliHLTAnyDataType                                <br>
+ *
+ * <h2>Mandatory arguments:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ *
+ * <h2>Optional arguments:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ *
+ * <h2>Configuration:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li -emin     <i> e   </i> <br>
+ *      minimum required energy of the cluster
+ *
+* \li -emax    <i> e   </i> <br>
+ *      maximum energy of the cluster
+ *
+ * \li -ncells     <i> e   </i> <br>
+ *      Maximum number of cells in cluster
+ *
+ * 
+ * By default, configuration is loaded from OCDB, can be overridden by
+ * component arguments.
+ *
+ * <h2>Default CDB entries:</h2>
+ * HLT/ConfigHLT/PhosMipTrigger: TObjString storing the arguments
+ *
+ * <h2>Performance:</h2>
+ * 
+ *
+ * <h2>Memory consumption:</h2>
+ * 
+ *
+ * <h2>Output size:</h2>
+ * 
+ *
+ * \ingroup alihlt_trigger_components
+ */
+
+class AliHLTTriggerPhosMip : public AliHLTTrigger
+{
+public:
+  AliHLTTriggerPhosMip();
+  ~AliHLTTriggerPhosMip();
+
+
+  /// inherited from AliHLTTrigger: name of this trigger
+  virtual const char* GetTriggerName() const;
+  /// inherited from AliHLTComponent: create an instance
+  virtual AliHLTComponent* Spawn();
+
+ protected:
+  /// inherited from AliHLTComponent: handle the initialization
+  int DoInit(int argc, const char** argv);
+
+  /// 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, scan one argument and
+  /// its parameters
+  int ScanConfigurationArgument(int argc, const char** argv);
+
+  /// inherited from AliHLTComponent
+  //  Get a ratio by how much the data volume is shrunken or enhanced.
+  virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+
+private:
+
+  /// inherited from AliHLTTrigger: calculate the trigger
+  virtual int DoTrigger();
+
+  /// Variables for triggger configuration
+  float fEMin;
+  float fEMax;
+  int fNCellsMax;
+
+  /// the default configuration entry for this component
+  static const char* fgkOCDBEntry; //!transient
+
+  ClassDef(AliHLTTriggerPhosMip, 0)
+};
+
+#endif //ALIHLTTRIGGERPHOSMIP_H
diff --git a/OCDB/HLT/ConfigHLT/PhosMipTrigger/Run0_999999999_v0_s0.root b/OCDB/HLT/ConfigHLT/PhosMipTrigger/Run0_999999999_v0_s0.root
new file mode 100644 (file)
index 0000000..468b916
Binary files /dev/null and b/OCDB/HLT/ConfigHLT/PhosMipTrigger/Run0_999999999_v0_s0.root differ