]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- first trigger version for ultra-peripheral collisions (Kyrre Skjerdal)
authorkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Apr 2010 15:42:30 +0000 (15:42 +0000)
committerkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Apr 2010 15:42:30 +0000 (15:42 +0000)
- added macro that runs the HLT reconstruction and processes the output through the trigger component
   (global trigger menu to be modified, so that the chain can be complete with the addition of the global trigger component)
- no arguments passed from OCDB entry yet

HLT/libAliHLTTrigger.pkg
HLT/trigger/AliHLTTriggerAgent.cxx
HLT/trigger/AliHLTTriggerLinkDef.h
HLT/trigger/AliHLTUpcTriggerComponent.cxx [new file with mode: 0644]
HLT/trigger/AliHLTUpcTriggerComponent.h [new file with mode: 0644]
HLT/trigger/macros/rec-upc-trigger.C [new file with mode: 0644]

index 64d8261034d379e725c42b07b4ed4b244e59d4e5..c3d705908fe9696df5b4a7d13db9157f4fdb8e0d 100644 (file)
@@ -37,7 +37,8 @@ CLASS_HDRS:= \
                AliHLTTriggerDecisionParameters.h           \
                AliHLTTriggerGammaConversion.h              \
                AliHLTMuonSpectroScalars.h                  \
-               AliHLTMuonSpectroTriggerComponent.h
+               AliHLTMuonSpectroTriggerComponent.h         \
+               AliHLTUpcTriggerComponent.h
 
 # library sources
 MODULE_SRCS:=  $(CLASS_HDRS:.h=.cxx)
index 56507fbbf9260835763ad5eb5c572701f9dc406e..c4be805740c276ce91c1bf3914e3bbbc0cb78c67 100644 (file)
@@ -50,6 +50,8 @@
 #include "AliHLTTriggerTrdClusterMultiplicity.h"
 #include "AliHLTTriggerGammaConversion.h"
 #include "AliHLTMuonSpectroTriggerComponent.h"
+#include "AliHLTUpcTriggerComponent.h"
+
 
 /** global instance for agent registration */
 AliHLTTriggerAgent gAliHLTTriggerAgent;
@@ -90,6 +92,7 @@ int AliHLTTriggerAgent::RegisterComponents(AliHLTComponentHandler* pHandler) con
   pHandler->AddComponent(new AliHLTTriggerTrdClusterMultiplicity);
   pHandler->AddComponent(new AliHLTTriggerGammaConversion);
   pHandler->AddComponent(new AliHLTMuonSpectroTriggerComponent);
+  pHandler->AddComponent(new AliHLTUpcTriggerComponent);
   return 0;
 }
 
index 8f7d228352b349ab9e0d29dc6b5a1542bf40a56b..4bb40fa0febe278523d67f4dfd86353688d863cd 100644 (file)
@@ -33,4 +33,5 @@
 #pragma link C++ class AliHLTMuonSpectroScalars+;
 #pragma link C++ class AliHLTMuonSpectroScalars::AliScalar+;
 #pragma link C++ class AliHLTMuonSpectroTriggerComponent+;
+#pragma link C++ class AliHLTUpcTriggerComponent+;
 #endif
diff --git a/HLT/trigger/AliHLTUpcTriggerComponent.cxx b/HLT/trigger/AliHLTUpcTriggerComponent.cxx
new file mode 100644 (file)
index 0000000..1399a7f
--- /dev/null
@@ -0,0 +1,153 @@
+// $Id$
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//*                                                                        *
+//* Primary Authors: Kyrre Skjerdal                                        *
+//*                  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   AliHLTUpcTriggerComponent.cxx
+/// @author Kyrre Skjerdal
+/// @date   2010-04-16
+/// @brief  HLT trigger component for Ultra-Peripheral Collisions
+
+// 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 "AliHLTUpcTriggerComponent.h"
+#include "AliESDEvent.h"
+#include "AliHLTTriggerDecision.h"
+#include "AliHLTDomainEntry.h"
+ClassImp(AliHLTUpcTriggerComponent)
+
+const char* AliHLTUpcTriggerComponent::GetTriggerName() const
+{
+  //See header file for documentation
+  return "UpcTrigger";
+}
+
+AliHLTComponent* AliHLTUpcTriggerComponent::Spawn()
+{
+  //See header file for documentation
+  return new AliHLTUpcTriggerComponent;
+}
+
+int AliHLTUpcTriggerComponent::DoTrigger()
+{
+  //See header file for documentation
+  HLTInfo("Entering DoTrigger()");
+  const TObject* obj = GetFirstInputObject(kAliHLTAllDataTypes, "AliESDEvent");
+  AliESDEvent* esd = dynamic_cast<AliESDEvent*>(const_cast<TObject*>(obj));
+  
+  if (esd != NULL){
+      esd->GetStdContent();     
+      //We skip events with no primary vertex reconstructed
+      if(!(PrimaryVertexReconstructed(esd))){
+       HLTWarning("No primary vertex reconstructed");
+       SetDescription("No reconstructed primary vertex. Not a candidate for an Ultra-peripheral Collison");
+       TriggerEvent(false);
+       return 0;
+      }
+      
+      Int_t nGoodRec = 0;
+      Int_t charge1 = 0;
+      Int_t charge2 = 0;
+      
+      for (Int_t i = 0; i < esd->GetNumberOfTracks(); i++){
+       cout << "Track number: " << esd->GetNumberOfTracks() << endl;
+       AliESDtrack* track = esd->GetTrack(i);
+
+       Int_t nItsClusters = track->GetNcls(0);
+       Int_t nTpcClusters = track->GetNcls(1);
+
+       Float_t bxy = 0;
+       Float_t bz = 0;
+       track->GetImpactParametersTPC(bxy, bz);
+       
+       //Check if the track is comming from the primary vertex
+       Bool_t isPrimary = kFALSE;
+       if(fabs(bxy) < 1.5 && fabs(bz) < 1.5){
+         isPrimary = kTRUE;
+       }
+       
+       Int_t charge = track->Charge();    
+       
+       if(nItsClusters > 3 && nTpcClusters > 50 && isPrimary){
+         nGoodRec++;
+         if(nGoodRec == 1){
+           charge1 = charge;
+         } else if(nGoodRec == 2){
+           charge2 = charge;
+         }
+       }
+       
+      }
+      
+      //Demand two good tracks with opposite charge
+      if(nGoodRec == 2){
+       if(charge1 == -charge2){
+         SetDescription("Event is a candidate for an Ultra-peripheral Collision.");
+         // Enable the central detectors for readout.
+         GetReadoutList().Enable(
+
+                                 AliHLTReadoutList::kITSSPD |
+                                 AliHLTReadoutList::kITSSDD |
+                                 AliHLTReadoutList::kITSSSD |
+                                 AliHLTReadoutList::kTPC    |
+                                 AliHLTReadoutList::kTRD    |
+                                 AliHLTReadoutList::kTRD    |
+                                 AliHLTReadoutList::kTOF    |
+                                 AliHLTReadoutList::kHMPID  |
+                                 AliHLTReadoutList::kPHOS   
+                                 );
+         // Add the available HLT information for readout too.
+         GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "ISPD");
+         GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "ISDD");
+         GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "ISSD");
+         GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "ITPC");
+         GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "ITRD");
+         GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "IPHOS");
+         TriggerEvent(true);
+         return 0;
+       }
+      }
+      
+  }else{
+    HLTFatal("No ESD found");
+    SetDescription("Not a candidate for an Ultra-peripheral Collision.");
+    TriggerEvent(false);
+    return 0;
+  }
+  SetDescription("Not a candidate for an Ultra-peripheral Collision.");
+  TriggerEvent(false);
+  return 0;
+}
+
+void AliHLTUpcTriggerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
+{
+  //See header file for documentation
+  
+  constBase = sizeof(AliHLTTriggerDecision) + sizeof(AliHLTDomainEntry)*14;
+  inputMultiplier = 1;
+}
+
+
+Bool_t AliHLTUpcTriggerComponent::PrimaryVertexReconstructed(const AliESDEvent *event) const
+{ 
+  //See header file for documentation
+  
+  return (event->GetPrimaryVertex()->GetNContributors() > 0);
+}
diff --git a/HLT/trigger/AliHLTUpcTriggerComponent.h b/HLT/trigger/AliHLTUpcTriggerComponent.h
new file mode 100644 (file)
index 0000000..ee1247c
--- /dev/null
@@ -0,0 +1,75 @@
+//-*- Mode: C++ -*-
+// $Id$
+//* 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   AliHLTUpcTriggerComponent.h
+/// @author Kyrre Skjerdal
+/// @date   2010-04-16
+/// @brief  HLT trigger component for Ultra-Peripheral Collisions (UPC)
+
+#ifndef ALIHLTUPCTRIGGERCOMPONENT_H
+#define ALIHLTUPCTRIGGERCOMPONENT_H
+
+#include "AliHLTTrigger.h"
+//#include "AliESDEvent.h"
+class AliESDEvent;
+
+/**
+ * @class  AliHLTUpcTriggerComponent
+ *
+ * HLT trigger component for Ultra-Peripheral Collisions
+ *
+ * <h2>General properties:</h2>
+ *
+ * Component ID: \b UpcTrigger                             <br>
+ * Library: \b libAliHLTTrigger.so                                        <br>
+ * Input Data Types:  kAliHLTAllDataTypes                              <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 -->
+ * By default, configuration is loaded from OCDB, can be overridden by
+ * component arguments.
+ *
+ * <h2>Default CDB entries:</h2>
+ *
+ *
+ * <h2>Performance:</h2>
+ * 
+ *
+ * <h2>Memory consumption:</h2>
+ * 
+ *
+ * <h2>Output size:</h2>
+ * 
+ *
+ * \ingroup alihlt_trigger_components
+ */
+
+class AliHLTUpcTriggerComponent : public AliHLTTrigger
+{
+public:
+  virtual ~AliHLTUpcTriggerComponent(){;}
+  //Returning the trigger name (UpcTrigger)
+  virtual const char* GetTriggerName() const;
+  //Returning a new object of the class
+  virtual AliHLTComponent* Spawn(); 
+  //Gives the output data size
+  virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+
+private:
+  //The trigger code
+  virtual int DoTrigger();
+  //Check if the event has a reconstructed primary vertex
+  Bool_t PrimaryVertexReconstructed(const AliESDEvent *event) const;
+  ClassDef(AliHLTUpcTriggerComponent, 0)
+};
+
+#endif
diff --git a/HLT/trigger/macros/rec-upc-trigger.C b/HLT/trigger/macros/rec-upc-trigger.C
new file mode 100644 (file)
index 0000000..efce1a6
--- /dev/null
@@ -0,0 +1,81 @@
+// $Id$
+/**
+ * @file rec-upc-trigger.C
+ * @brief Test macro for UPC trigger
+ *
+ * Usage:
+ * <pre>
+ *   aliroot -b -q rec-upc-trigger.C | tee rec-upc-trigger.log
+ * </pre>
+ *
+ * The macro asumes raw data to be available in the rawx folders, either
+ * simulated or real data. A different input can be specified as parameter
+ * <pre>
+ *   aliroot -b -q rec-upc-trigger.C'("input.root")'
+ * </pre>
+ *
+ *
+ * @author Kyrre Skjerdal (kyrre.skjerdal@cern.ch)
+ */
+
+void rec_upc_trigger(const char *filename="raw.root"){
+
+  if(!gSystem->AccessPathName("galice.root")){
+    cerr << "Remove galice.root or run in a different folder." << endl;
+    return;
+  }
+
+  if (!filename) {
+    cerr << "please specify input or run without arguments" << endl;
+    return;
+  }
+  
+  // Set the CDB storage location
+  AliCDBManager *man = AliCDBManager::Instance();
+  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB/");
+  
+
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // init the HLT system in order to define the analysis chain below
+  //
+  AliHLTSystem *gHLT = AliHLTPluginBase::GetInstance();
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // define the analysis chain to be run
+  //
+ // AliHLTConfiguration pubconf("hltesd-publisher", "ESDMCEventPublisher", NULL , "-entrytype HLTESD -datapath ..");
+
+  AliHLTConfiguration triggerconf("upc", "UpcTrigger", "GLOBAL-esd-converter", "");
+ //AliHLTConfiguration globaltriggerconf("global-trigger", "HLTGlobalTrigger", "multiplicity-trigger" , "");
+
+  // Reconstruction settings
+  AliReconstruction rec;
+
+  // QA options
+  rec.SetRunQA(":") ;
+
+  // AliReconstruction settings
+  rec.SetInput(filename);
+  rec.SetSpecificStorage("GRP/GRP/Data",Form("local://%s",gSystem->pwd()));
+  rec.SetEventRange(0,100);
+  rec.SetRunVertexFinder(kFALSE);
+  
+  rec.SetRunLocalReconstruction("HLT");
+  rec.SetRunTracking("");
+  rec.SetFillESD("");
+  
+  //rec.SetRunReconstruction("HLT");
+  //rec.SetLoadAlignFromCDB(0);
+  
+  rec.SetOption("HLT", "loglevel=0x7c chains=upc");
+
+  rec.Run();
+
+}