First version of HLT component using AliAnalysisManager
authorzampolli <chiara.zampolli@cern.ch>
Wed, 28 May 2014 14:48:48 +0000 (16:48 +0200)
committerzampolli <chiara.zampolli@cern.ch>
Wed, 28 May 2014 14:48:48 +0000 (16:48 +0200)
12 files changed:
ANALYSIS/ANALYSISaliceLinkDef.h
ANALYSIS/AliAnalysisTaskPt.cxx [new file with mode: 0644]
ANALYSIS/AliAnalysisTaskPt.h [new file with mode: 0644]
ANALYSIS/CMakelibANALYSISalice.pkg
HLT/CMakelibAliHLTGlobal.pkg
HLT/global/AliHLTGlobalAgent.cxx
HLT/global/physics/AliHLTAnaManagerComponent.cxx [new file with mode: 0644]
HLT/global/physics/AliHLTAnaManagerComponent.h [new file with mode: 0644]
STEER/CMakelibSTEER.pkg
STEER/STEER/AliHLTTestInputHandler.cxx [new file with mode: 0644]
STEER/STEER/AliHLTTestInputHandler.h [new file with mode: 0644]
STEER/STEERLinkDef.h

index 3e2e6c6..9a35105 100644 (file)
@@ -50,6 +50,7 @@
 
 #pragma link C++ class AliAnalysisUtils+;
 #pragma link C++ class AliAnalysisTaskBadChunkID+;
+#pragma link C++ class  AliAnalysisTaskPt+;
 
 #ifdef WITHXML
 #pragma link C++ class AliTagAnalysis+;
diff --git a/ANALYSIS/AliAnalysisTaskPt.cxx b/ANALYSIS/AliAnalysisTaskPt.cxx
new file mode 100644 (file)
index 0000000..6d62203
--- /dev/null
@@ -0,0 +1,131 @@
+#include "TChain.h"
+#include "TTree.h"
+#include "TH1F.h"
+#include "TCanvas.h"
+#include "TObjArray.h"
+
+#include "AliAnalysisTask.h"
+#include "AliAnalysisManager.h"
+
+#include "AliESDEvent.h"
+#include "AliESDtrackCuts.h"
+#include "AliESDInputHandler.h"
+
+#include "AliAnalysisTaskPt.h"
+
+// example of an analysis task creating a p_t spectrum
+// Authors: Panos Cristakoglou, Jan Fiete Grosse-Oetringhaus, Christian Klein-Boesing
+
+ClassImp(AliAnalysisTaskPt)
+
+//________________________________________________________________________
+AliAnalysisTaskPt::AliAnalysisTaskPt(const char *name) 
+: AliAnalysisTask(name, ""), fESD(0), fHistPt(0), fCuts(0), fEv(0)
+{
+  // Constructor
+
+  // Define input and output slots here
+  // Input slot #0 works with a TChain
+  DefineInput(0, TChain::Class());
+  // Output slot #0 writes into a TH1 container
+  DefineOutput(0, TH1F::Class());
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskPt::ConnectInputData(Option_t *) 
+{
+  // Connect ESD or AOD here
+  // Called once
+
+  printf("AliAnalysisTaskPt::ConnectInputData\n");
+  TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
+  if (!tree) {
+    Printf("ERROR: Could not read chain from input slot 0");
+  } else {
+    // Disable all branches and enable only the needed ones
+    // The next two lines are different when data produced as AliESDEvent is read
+    /*
+    tree->SetBranchStatus("*", kFALSE);
+    tree->SetBranchStatus("fTracks.*", kTRUE);
+    */
+
+    AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+
+    if (!esdH) {
+      Printf("ERROR: Could not get ESDInputHandler");
+    } else
+      fESD = esdH->GetEvent();
+  }
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskPt::CreateOutputObjects()
+{
+  // Create histograms
+  // Called once
+
+
+  fHistPt = new TH1F("fHistPt", "P_{T} distribution", 15, 0.1, 3.1);
+  fHistPt->GetXaxis()->SetTitle("P_{T} (GeV/c)");
+  fHistPt->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)");
+  fHistPt->SetMarkerStyle(kFullCircle);
+
+  fCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(1);
+  PostData(0, fHistPt);
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskPt::Exec(Option_t *) 
+{
+  // Main loop
+  // Called for each event
+
+   AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+
+   if (!esdH) {
+     Printf("ERROR: Could not get ESDInputHandler");
+   } else
+     fESD = esdH->GetEvent();
+  if (!fESD) {
+    Printf("ERROR: fESD not available");
+    return;
+  }
+
+  Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
+
+  // Track loop to fill a pT spectrum
+  for (Int_t iTracks = 0; iTracks < fESD->GetNumberOfTracks(); iTracks++) {
+    AliESDtrack* track = fESD->GetTrack(iTracks);
+    if (!track) {
+      Printf("ERROR: Could not receive track %d", iTracks);
+      continue;
+    }
+
+    fHistPt->Fill(track->Pt());
+  } //track loop 
+
+  TObjArray* tmp = fCuts->GetAcceptedTracks(fESD);
+  Printf("Event %d has %d accepted tracks", fEv, tmp->GetEntries());
+  // Post output data.
+  PostData(0, fHistPt);
+  fEv++;
+}      
+
+//________________________________________________________________________
+void AliAnalysisTaskPt::Terminate(Option_t *) 
+{
+  // Draw result to the screen
+  // Called once at the end of the query
+
+  Printf("Terminate called");
+
+  fHistPt = dynamic_cast<TH1F*> (GetOutputData(0));
+  if (!fHistPt) {
+    Printf("ERROR: fHistPt not available");
+    return;
+  }
+   
+  TCanvas *c1 = new TCanvas("AliAnalysisTaskPt","Pt",10,10,510,510);
+  c1->cd(1)->SetLogy();
+  fHistPt->DrawCopy("E");
+}
diff --git a/ANALYSIS/AliAnalysisTaskPt.h b/ANALYSIS/AliAnalysisTaskPt.h
new file mode 100644 (file)
index 0000000..ac83e18
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef AliAnalysisTaskPt_cxx
+#define AliAnalysisTaskPt_cxx
+
+// example of an analysis task creating a p_t spectrum
+// Authors: Panos Cristakoglou, Jan Fiete Grosse-Oetringhaus, Christian Klein-Boesing
+
+class TH1F;
+class AliESDEvent;
+class AliESDtrackCuts;
+
+#include "AliAnalysisTask.h"
+
+class AliAnalysisTaskPt : public AliAnalysisTask {
+ public:
+ AliAnalysisTaskPt() : AliAnalysisTask(), fESD(0), fHistPt(0), fCuts(0), fEv(0) {}
+  AliAnalysisTaskPt(const char *name);
+  virtual ~AliAnalysisTaskPt() {}
+  
+  virtual void   ConnectInputData(Option_t *);
+  virtual void   CreateOutputObjects();
+  virtual void   Exec(Option_t *option);
+  virtual void   Terminate(Option_t *);
+  
+ private:
+  AliESDEvent *fESD;    //ESD object
+  TH1F        *fHistPt; //Pt spectrum
+  AliESDtrackCuts* fCuts;
+  Int_t fEv;
+   
+  AliAnalysisTaskPt(const AliAnalysisTaskPt&); // not implemented
+  AliAnalysisTaskPt& operator=(const AliAnalysisTaskPt&); // not implemented
+  
+  ClassDef(AliAnalysisTaskPt, 1); // example of analysis
+};
+
+#endif
index 9d0adbe..59b8170 100644 (file)
@@ -64,6 +64,7 @@ set ( SRCS
     AliAnalysisUtils.cxx
     BadChunkFilter/AliAnalysisTaskBadChunkID.cxx
     AliAODv0KineCuts.cxx
+    AliAnalysisTaskPt.cxx
     )
 
 if( ROOTHASALIEN STREQUAL "yes")
index 77ef842..304a699 100644 (file)
@@ -57,6 +57,7 @@ set ( CLASS_HDRS
     physics/AliHLTCaloHistoCellEnergy.h
     physics/AliHLTMultiplicityCorrelations.h
     physics/AliHLTMultiplicityCorrelationsComponent.h
+    physics/AliHLTAnaManagerComponent.h
     )
 
 string ( REPLACE ".h" ".cxx" MODULE_SRCS "${CLASS_HDRS}" )
index 5e2dcc9..d6e10b6 100644 (file)
@@ -44,6 +44,7 @@
 #include "AliHLTMultiplicityCorrelationsComponent.h"
 #include "AliHLTPrimaryVertexFinderComponent.h"
 #include "AliHLTV0FinderComponent.h"
+#include "AliHLTAnaManagerComponent.h"
 
 // header file for preprocessor plugin
 #include "AliHLTGlobalPreprocessor.h"
@@ -90,6 +91,7 @@ int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) cons
   pHandler->AddComponent(new AliHLTV0FinderComponent);
   pHandler->AddComponent(new AliHLTGlobalHistoCollector );
   pHandler->AddComponent(new AliHLTGlobalDCSPublisherComponent );
+  pHandler->AddComponent(new AliHLTAnaManagerComponent);
   return 0;
 }
 
diff --git a/HLT/global/physics/AliHLTAnaManagerComponent.cxx b/HLT/global/physics/AliHLTAnaManagerComponent.cxx
new file mode 100644 (file)
index 0000000..5d2d772
--- /dev/null
@@ -0,0 +1,250 @@
+//-*- Mode: C++ -*-
+// $Id: AliHLTAnaManagerComponent.cxx $
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * ALICE Experiment at CERN, All rights reserved.                         *
+ *                                                                        *
+ * Primary Authors: David Rohr, Jens Wiechula, C. Zampolli                *
+ *                                                                        *
+ * 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    AliHLTAnaManagerComponent.cxx
+    @author  David Rohr, Jens Wiechula, C. Zampolli
+    @brief   Component for Testing Analysis Manager inside HLT component
+*/
+
+#include "TMap.h"
+#include "TSystem.h"
+#include "TTimeStamp.h"
+#include "TObjString.h"
+#include "TH1F.h"
+#include "TList.h"
+#include "AliESDtrackCuts.h"
+#include "AliHLTErrorGuard.h"
+#include "AliHLTDataTypes.h"
+#include "AliHLTAnaManagerComponent.h"
+#include "AliHLTITSClusterDataFormat.h"
+#include "AliAnalysisManager.h"
+#include "AliHLTTestInputHandler.h"
+#include "AliAnalysisTaskPt.h"
+#include "AliAnalysisDataContainer.h"
+#include "TTree.h"
+
+using namespace std;
+
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTAnaManagerComponent)
+
+/*
+ * ---------------------------------------------------------------------------------
+ *                            Constructor / Destructor
+ * ---------------------------------------------------------------------------------
+ */
+
+// #################################################################################
+AliHLTAnaManagerComponent::AliHLTAnaManagerComponent() :
+  AliHLTProcessor(),
+  fUID(0),
+  fAnalysisManager(NULL),
+  fInputHandler(NULL) {
+  // an example component which implements the ALICE HLT processor
+  // interface and does some analysis on the input raw data
+  //
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+  //
+  // NOTE: all helper classes should be instantiated in DoInit()
+}
+
+// #################################################################################
+AliHLTAnaManagerComponent::~AliHLTAnaManagerComponent() {
+  // see header file for class documentation
+}
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Public functions to implement AliHLTComponent's interface.
+ * These functions are required for the registration process
+ * ---------------------------------------------------------------------------------
+ */
+
+// #################################################################################
+const Char_t* AliHLTAnaManagerComponent::GetComponentID() { 
+  // see header file for class documentation
+  return "AnaManagerComponent";
+}
+
+// #################################################################################
+void AliHLTAnaManagerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
+  // see header file for class documentation
+  list.push_back(kAliHLTDataTypeESDObject|kAliHLTDataOriginAny);
+  list.push_back(kAliHLTDataTypeClusters|kAliHLTDataOriginITSSPD);
+  list.push_back(kAliHLTDataTypeESDContent|kAliHLTDataOriginVZERO);
+}
+
+// #################################################################################
+AliHLTComponentDataType AliHLTAnaManagerComponent::GetOutputDataType() {
+  // see header file for class documentation
+  return kAliHLTDataTypeTObject|kAliHLTDataOriginHLT;
+}
+
+// #################################################################################
+void AliHLTAnaManagerComponent::GetOutputDataSize( ULong_t& constBase, Double_t& inputMultiplier ) {
+  // see header file for class documentation
+  constBase = 100000;
+  inputMultiplier = 0.5;
+}
+
+// #################################################################################
+void AliHLTAnaManagerComponent::GetOCDBObjectDescription( TMap* const targetMap) {
+  // see header file for class documentation
+
+  if (!targetMap) return;
+  targetMap->Add(new TObjString("HLT/ConfigGlobal/MultiplicityCorrelations"),
+                new TObjString("configuration object"));
+  targetMap->Add(new TObjString("HLT/ConfigGlobal/MultiplicityCorrelationsCentrality"),
+                new TObjString("centrality configuration object"));
+
+  return;
+}
+
+// #################################################################################
+AliHLTComponent* AliHLTAnaManagerComponent::Spawn() {
+  // see header file for class documentation
+  return new AliHLTAnaManagerComponent;
+}
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Protected functions to implement AliHLTComponent's interface.
+ * These functions provide initialization as well as the actual processing
+ * capabilities of the component. 
+ * ---------------------------------------------------------------------------------
+ */
+
+// #################################################################################
+Int_t AliHLTAnaManagerComponent::DoInit( Int_t argc, const Char_t** argv ) {
+  // see header file for class documentation
+  printf("AliHLTAnaManagerComponent::DoInit\n");
+
+  Int_t iResult=0;
+
+  fAnalysisManager = new AliAnalysisManager;
+  fInputHandler    = new AliHLTTestInputHandler;
+  fAnalysisManager->SetInputEventHandler(fInputHandler);
+  fAnalysisManager->SetExternalLoop(kTRUE); 
+
+  AliAnalysisTaskPt *task = new AliAnalysisTaskPt("TaskPt");
+  fAnalysisManager->AddTask(task);
+  AliAnalysisDataContainer *cinput  = fAnalysisManager->GetCommonInputContainer();
+  Printf("Defining output file");
+  AliAnalysisDataContainer *coutput1 = fAnalysisManager->CreateContainer("pt", TH1::Class(),
+      AliAnalysisManager::kOutputContainer, "Pt.ESD.root");
+
+  //           connect containers
+  fAnalysisManager->ConnectInput  (task,  0, cinput );
+  Printf("---> Connecting output...");
+  fAnalysisManager->ConnectOutput (task,  0, coutput1);
+  Printf("---> ...connected.");
+
+  fAnalysisManager->InitAnalysis();
+  fAnalysisManager->StartAnalysis("local", (TTree*)new TTree);
+
+  return iResult;
+}
+
+
+
+// #################################################################################
+Int_t AliHLTAnaManagerComponent::DoDeinit() {
+  // see header file for class documentation
+
+  fUID = 0;
+  fAnalysisManager->SetSkipTerminate(kTRUE);
+  fAnalysisManager->Terminate();
+
+  delete fAnalysisManager;
+
+  return 0;
+}
+
+// #################################################################################
+Int_t AliHLTAnaManagerComponent::DoEvent(const AliHLTComponentEventData& evtData,
+                                       AliHLTComponentTriggerData& /*trigData*/) {
+  // see header file for class documentation
+
+  printf("AliHLTAnaManagerComponent::DoEvent\n");
+  Int_t iResult=0;
+
+  // -- Only use data event
+  if (!IsDataEvent()) 
+    return 0;
+  
+  if( fUID == 0 ){
+    TTimeStamp t;
+    fUID = ( gSystem->GetPid() + t.GetNanoSec())*10 + evtData.fEventID;
+  }
+  
+  // -- Get ESD object
+  // -------------------
+  AliESDEvent *esdEvent = NULL;
+  for ( const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDObject); iter != NULL; iter = GetNextInputObject() ) {
+    esdEvent = dynamic_cast<AliESDEvent*>(const_cast<TObject*>( iter ) );
+    if( !esdEvent ){ 
+      HLTWarning("Wrong ESDEvent object received");
+      iResult = -1;
+      continue;
+    }
+    esdEvent->GetStdContent();
+  }
+  printf("ESDEvent: %p\n",esdEvent);
+
+  fInputHandler->SetEvent(esdEvent);
+  fInputHandler->BeginEvent(0);
+  fAnalysisManager->ExecAnalysis();
+  fInputHandler->FinishEvent();
+
+
+  // -- Send histlist
+//  PushBack(dynamic_cast<TObject*>(fCorrObj->GetHistList()),
+//        kAliHLTDataTypeTObject|kAliHLTDataOriginHLT,fUID);
+  return iResult;
+}
+
+// #################################################################################
+Int_t AliHLTAnaManagerComponent::Reconfigure(const Char_t* cdbEntry, const Char_t* chainId) {
+  // see header file for class documentation
+
+  Int_t iResult=0;
+  TString cdbPath;
+  if (cdbEntry) {
+    cdbPath=cdbEntry;
+  } else {
+    cdbPath="HLT/ConfigGlobal/";
+    cdbPath+=GetComponentID();
+  }
+
+  AliInfoClass(Form("reconfigure '%s' from entry %s%s", chainId, cdbPath.Data(), cdbEntry?"":" (default)"));
+  iResult=ConfigureFromCDBTObjString(cdbPath);
+
+  return iResult;
+}
+
+// #################################################################################
+Int_t AliHLTAnaManagerComponent::ReadPreprocessorValues(const Char_t* /*modules*/) {
+  // see header file for class documentation
+  ALIHLTERRORGUARD(5, "ReadPreProcessorValues not implemented for this component");
+  return 0;
+}
+
diff --git a/HLT/global/physics/AliHLTAnaManagerComponent.h b/HLT/global/physics/AliHLTAnaManagerComponent.h
new file mode 100644 (file)
index 0000000..3c35414
--- /dev/null
@@ -0,0 +1,231 @@
+//-*- Mode: C++ -*-
+// $Id: AliHLTAnaManagerComponent $
+
+#ifndef ALIHLTANAMANAGERCOMPONENT_H
+#define ALIHLTANAMANAGERCOMPONENT_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    AliHLTAnaManagerComponent.h
+    @author  Jochen Thaeder <jochen@thaeder.de>
+    @brief   Component for Multiplicty Correlations
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTProcessor.h"
+
+class TH1F;
+class TList;
+
+class AliESDEvent;
+class AliESDVZERO;
+class AliESDtrackCuts;
+class AliHLTCTPData;
+class AliHLTMultiplicityCorrelations;
+class AliHLTGlobalTriggerDecision;
+class AliAnalysisManager;
+class AliHLTTestInputHandler;
+
+/**
+ * @class AliHLTAnaManagerComponent
+ * Create Correlations for Multiplicities
+ * 
+ * <h2>General properties:</h2>
+ *
+ * Component ID: \b MultiplicityCorrelations <br>
+ * Library: \b libAliHLTGlobal.so     <br>
+ * Input Data Types:  @ref kAliHLTDataTypeESDObject <br>
+ * Output Data Types: @ref kAliHLTDataTypeTObject|kAliHLTDataOriginHLT <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 -minpt    <i> pt  </i> <br>
+ *      minimum pt - pt range
+ * \li -maxpt    <i> pt  </i> <br>
+ *      maximum pt - pt range
+ * \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 -etarange    <i> eta  </i> <br>
+ *      +/- eta range
+ *
+ * \li -binningVzero    <i> bins min max  </i> <br>
+ *       bins (Int_t), minBin (Float_t), maxBin (Float_t)
+ * \li -binningTpc      <i> bins min max  </i> <br>
+ *       bins (Int_t), minBin (Float_t), maxBin (Float_t)
+ * \li -binningZdc      <i> bins min max  </i> <br>
+ *       bins (Int_t), minBin (Float_t), maxBin (Float_t)
+ * \li -binningZnp     <i> bins min max  </i> <br>
+ *       bins (Int_t), minBin (Float_t), maxBin (Float_t)
+ * \li -binningZem     <i> bins min max  </i> <br>
+ *       bins (Int_t), minBin (Float_t), maxBin (Float_t)
+ * \li -binningCalo    <i> bins min max  </i> <br>
+ *       bins (Int_t), minBin (Float_t), maxBin (Float_t)
+ *
+ * \li -addTrigger     <i> TriggerClass beginning (eg CPBI1)  </i> <br>
+
+ * <h2>Default CDB entries:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ *
+ * <tt>HLT/ConfigGlobal/MultiplicityCorrelations</tt>
+ * \li -TObjString object holding a string with the configuration parameters
+ *      currently empty 
+ *
+ * <h2>Performance:</h2>
+ *
+ * <h2>Memory consumption:</h2>
+ *
+ * <h2>Input size:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ *
+ * \li pp: 
+ *
+ * <h2>Output size:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ *
+ * \li pp: Average : 
+ *
+ * <h2>Macros Tests</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ *
+ * <tt>macros/makeConfigurationObjectMultiplicityCorrelations.C</tt>
+ * \li - Create configuration TObjString
+ *
+ * <tt>macros/HLTMultiplicityCorrelationsTest.C</tt>
+ * \li - Test macro for test in off-line environment
+ *
+ * <tt>macros/runMultiplicityCorrelationsTest.sh</tt>
+ * \li - Run Test macro HLTMultiplicityCorrelationsTest.C
+ *
+ * @ingroup alihlt_physics
+ */
+class AliHLTAnaManagerComponent : public AliHLTProcessor {
+public:
+
+  /*
+   * ---------------------------------------------------------------------------------
+   *                            Constructor / Destructor
+   * ---------------------------------------------------------------------------------
+   */
+
+  /** constructor */
+  AliHLTAnaManagerComponent();
+  
+  /** destructor */
+  virtual ~AliHLTAnaManagerComponent();
+
+  /*
+   * ---------------------------------------------------------------------------------
+   * Public functions to implement AliHLTComponent's interface.
+   * These functions are required for the registration process
+   * ---------------------------------------------------------------------------------
+   */
+
+  /** interface function, see @ref AliHLTComponent for description */
+  const Char_t* GetComponentID();
+
+  /** interface function, see @ref AliHLTComponent for description */
+  void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
+
+  /** interface function, see @ref AliHLTComponent for description */
+  AliHLTComponentDataType GetOutputDataType();
+
+  /** interface function, see @ref AliHLTComponent for description */
+  void GetOutputDataSize( ULong_t& constBase, Double_t& inputMultiplier );
+
+  /** interface function, see @ref AliHLTComponent for description */
+  void GetOCDBObjectDescription( TMap* const targetMap);
+
+  /** interface function, see @ref AliHLTComponent for description */
+  AliHLTComponent* Spawn();
+
+ protected:
+
+  /*
+   * ---------------------------------------------------------------------------------
+   * Protected functions to implement AliHLTComponent's interface.
+   * These functions provide initialization as well as the actual processing
+   * capabilities of the component. 
+   * ---------------------------------------------------------------------------------
+   */
+
+  // AliHLTComponent interface functions
+
+  /** interface function, see @ref AliHLTComponent for description */
+  Int_t DoInit( Int_t argc, const Char_t** argv );
+
+  /** interface function, see @ref AliHLTComponent for description */
+  Int_t DoDeinit();
+
+  /** interface function, see @ref AliHLTComponent for description */
+  Int_t DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
+
+  using AliHLTProcessor::DoEvent;
+
+
+  /** interface function, see @ref AliHLTComponent for description */
+  Int_t Reconfigure(const Char_t* cdbEntry, const Char_t* chainId);
+
+  /** interface function, see @ref AliHLTComponent for description */
+  Int_t ReadPreprocessorValues(const Char_t* modules);
+  ///////////////////////////////////////////////////////////////////////////////////
+  
+private:
+
+  /*
+   * ---------------------------------------------------------------------------------
+   * Private functions to implement AliHLTComponent's interface.
+   * These functions provide initialization as well as the actual processing
+   * capabilities of the component. 
+   * ---------------------------------------------------------------------------------
+   */
+
+  /** copy constructor prohibited */
+  AliHLTAnaManagerComponent(const AliHLTAnaManagerComponent&);
+
+  /** assignment operator prohibited */
+  AliHLTAnaManagerComponent& operator=(const AliHLTAnaManagerComponent&);
+
+
+  /*
+   * ---------------------------------------------------------------------------------
+   *                              Helper
+   * ---------------------------------------------------------------------------------
+   */
+
+  /*
+   * ---------------------------------------------------------------------------------
+   *                             Members - private
+   * ---------------------------------------------------------------------------------
+   */
+  
+  /** UID for merging */
+  AliHLTUInt32_t fUID;                        // see above
+
+  AliAnalysisManager *fAnalysisManager;        // Manger
+
+  AliHLTTestInputHandler *fInputHandler;    // input handler
+
+  ClassDef(AliHLTAnaManagerComponent, 0)
+};
+#endif
index 82bad97..f2c942e 100644 (file)
@@ -118,6 +118,7 @@ set ( SRCS
     STEER/AliTransportMonitor.cxx
     STEER/AliParamList.cxx
     STEER/AliMCGenHandler.cxx
+    STEER/AliHLTTestInputHandler.cxx
     )
 
 string(REPLACE ".cxx" ".h" HDRS  "${SRCS}")
diff --git a/STEER/STEER/AliHLTTestInputHandler.cxx b/STEER/STEER/AliHLTTestInputHandler.cxx
new file mode 100644 (file)
index 0000000..981aaf1
--- /dev/null
@@ -0,0 +1,53 @@
+/**************************************************************************
+ * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+//-------------------------------------------------------------------------
+//     Event handler for reconstruction
+//     Author: Andrei Gheata, CERN
+//-------------------------------------------------------------------------
+
+#include "AliHLTTestInputHandler.h"
+#include "AliVCuts.h"
+
+ClassImp(AliHLTTestInputHandler)
+
+//______________________________________________________________________________
+AliHLTTestInputHandler::AliHLTTestInputHandler(const char* name, const char* title) 
+  : AliESDInputHandler(name,title)
+{
+// Named constructor
+}
+
+//______________________________________________________________________________
+Bool_t AliHLTTestInputHandler::Init(TTree* tree,  Option_t* opt)
+{
+// Initialisation necessary for each new tree. In reco case this is once.
+   fAnalysisType = opt;
+   fTree = tree;
+   if (!fTree) return kFALSE;
+   fNEvents = fTree->GetEntries();
+   return kTRUE;
+}  
+//______________________________________________________________________________
+Bool_t AliHLTTestInputHandler::BeginEvent(Long64_t)
+{
+// Called at the beginning of every event   
+  static Bool_t called = kFALSE;
+  if (!called && fEventCuts && IsUserCallSelectionMask())
+     AliInfo(Form("The ESD input handler expects that the first task calls AliESDInputHandler::CheckSelectionMask() %s", fEventCuts->ClassName()));
+  fNewEvent = kTRUE;
+  called = kTRUE;
+  return kTRUE;
+}     
diff --git a/STEER/STEER/AliHLTTestInputHandler.h b/STEER/STEER/AliHLTTestInputHandler.h
new file mode 100644 (file)
index 0000000..2e34f45
--- /dev/null
@@ -0,0 +1,72 @@
+#ifndef ALIHLTTESTINPUTHANDLER_H
+#define ALIHLTTESTINPUTHANDLER_H
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//-------------------------------------------------------------------------
+//     Reconstruction-specific input handler
+//     Author: Andrei Gheata, CERN
+//-------------------------------------------------------------------------
+
+#ifndef ALIESDINPUTHANDLER_H
+#include "AliESDInputHandler.h"
+#endif
+
+class AliReconstruction;
+
+class AliHLTTestInputHandler : public AliESDInputHandler {
+
+ public:
+    AliHLTTestInputHandler() {}
+    AliHLTTestInputHandler(const char* name, const char* title);
+    virtual ~AliHLTTestInputHandler() {}
+    virtual Bool_t       Notify() { return AliESDInputHandler::Notify(); };
+    virtual Bool_t       Notify(const char *) {return kTRUE;}
+    virtual Bool_t       Init(Option_t* opt) {return AliESDInputHandler::Init(opt);}
+    virtual Bool_t       Init(TTree* tree, Option_t* opt="LOCAL");
+    virtual Bool_t       BeginEvent(Long64_t entry);
+    virtual Bool_t       FinishEvent() {return kTRUE;}
+//    void                 CheckSelectionMask();
+//    AliESDEvent         *GetEvent()        const {return fEvent;}
+//    Option_t            *GetAnalysisType() const {return fAnalysisType;}
+//    Option_t            *GetDataType() const;
+    // Tag cut summary analysis
+//    Int_t                GetNEventAcceptedInFile();
+//    Int_t                GetNEventRejectedInFile();
+//    Bool_t               GetCutSummaryForChain(Int_t *aTotal, Int_t *aAccepted, Int_t *aRejected);
+//    Int_t                GetNFilesEmpty();
+    // HLT  analysis
+//    AliESDEvent         *GetHLTEvent()     const {return fHLTEvent;}
+//    TTree               *GetHLTTree()      const {return fHLTTree;}    
+//    void                 SetReadHLT()            {fUseHLT = kTRUE;}
+    // Friends&Co
+//    AliESDfriend        *GetESDfriend()    const {return fFriend;}
+//    void                 SetReadFriends(Bool_t flag)   {fReadFriends = flag;}
+//    void                 SetFriendFileName(const char *fname)  {fFriendFileName = fname;}
+    // Tag analysis
+//    void                 SetReadTags()           {fUseTags = kTRUE;}
+//    AliRunTag           *GetRunTag() const       {return fRunTag;}
+//    const AliEventTag   *GetEventTag() const     {return fEventTag;}
+    // Get the statistics object (currently TH2). Option can be BIN0.
+//    virtual TObject     *GetStatistics(Option_t *option="") const;
+
+    //PID response
+//    virtual AliPIDResponse* GetPIDResponse() {return (AliPIDResponse*)fESDpid;}
+//    virtual void CreatePIDResponse(Bool_t isMC=kFALSE);
+//    AliESDpid           *GetESDpid()       const {return fESDpid;}
+//    void                 SetESDpid(AliESDpid* pid)     {fESDpid = pid;}
+      
+// private:
+    AliHLTTestInputHandler(const AliESDInputHandler& handler);             
+    AliHLTTestInputHandler& operator=(const AliESDInputHandler& handler);  
+    // Private setters used by AliReconstruction
+    friend class AliReconstruction;
+    void                 SetEvent(AliESDEvent *event)          {fEvent = event;}
+    void                 SetESDfriend(AliESDfriend *esdfriend) {fFriend = esdfriend;}
+    void                 SetHLTEvent(AliESDEvent *hltevent)    {fHLTEvent = hltevent;}
+    void                 SetHLTTree(TTree *hlttree)            {fHLTTree = hlttree;}
+    
+    ClassDef(AliHLTTestInputHandler, 1);
+};
+
+#endif
index d34148d..6966054 100644 (file)
 #pragma link C++ typedef AliLHCDipValC;
 
 #pragma link C++ class AliMCGenHandler+;
+#pragma link C++ class  AliHLTTestInputHandler+;
 
 #endif