From: zampolli Date: Wed, 28 May 2014 14:48:48 +0000 (+0200) Subject: First version of HLT component using AliAnalysisManager X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=b9f1d9176e73b98e0477014707c63026a72bf8e6 First version of HLT component using AliAnalysisManager --- diff --git a/ANALYSIS/ANALYSISaliceLinkDef.h b/ANALYSIS/ANALYSISaliceLinkDef.h index 3e2e6c676c2..9a35105da4b 100644 --- a/ANALYSIS/ANALYSISaliceLinkDef.h +++ b/ANALYSIS/ANALYSISaliceLinkDef.h @@ -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 index 00000000000..6d622038a89 --- /dev/null +++ b/ANALYSIS/AliAnalysisTaskPt.cxx @@ -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 (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 (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 (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 (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 index 00000000000..ac83e1845a0 --- /dev/null +++ b/ANALYSIS/AliAnalysisTaskPt.h @@ -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 diff --git a/ANALYSIS/CMakelibANALYSISalice.pkg b/ANALYSIS/CMakelibANALYSISalice.pkg index 9d0adbed6b5..59b81708993 100644 --- a/ANALYSIS/CMakelibANALYSISalice.pkg +++ b/ANALYSIS/CMakelibANALYSISalice.pkg @@ -64,6 +64,7 @@ set ( SRCS AliAnalysisUtils.cxx BadChunkFilter/AliAnalysisTaskBadChunkID.cxx AliAODv0KineCuts.cxx + AliAnalysisTaskPt.cxx ) if( ROOTHASALIEN STREQUAL "yes") diff --git a/HLT/CMakelibAliHLTGlobal.pkg b/HLT/CMakelibAliHLTGlobal.pkg index 77ef8427257..304a6993edc 100644 --- a/HLT/CMakelibAliHLTGlobal.pkg +++ b/HLT/CMakelibAliHLTGlobal.pkg @@ -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}" ) diff --git a/HLT/global/AliHLTGlobalAgent.cxx b/HLT/global/AliHLTGlobalAgent.cxx index 5e2dcc91108..d6e10b6c5a6 100644 --- a/HLT/global/AliHLTGlobalAgent.cxx +++ b/HLT/global/AliHLTGlobalAgent.cxx @@ -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 index 00000000000..5d2d772e15d --- /dev/null +++ b/HLT/global/physics/AliHLTAnaManagerComponent.cxx @@ -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& 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(const_cast( 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(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 index 00000000000..3c354145ded --- /dev/null +++ b/HLT/global/physics/AliHLTAnaManagerComponent.h @@ -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 + @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 + * + *

General properties:

+ * + * Component ID: \b MultiplicityCorrelations
+ * Library: \b libAliHLTGlobal.so
+ * Input Data Types: @ref kAliHLTDataTypeESDObject
+ * Output Data Types: @ref kAliHLTDataTypeTObject|kAliHLTDataOriginHLT
+ * + *

Mandatory arguments:

+ * + * + *

Optional arguments:

+ * + * + *

Configuration:

+ * + * + * \li -minpt pt
+ * minimum pt - pt range + * \li -maxpt pt
+ * maximum pt - pt range + * \li -min-ldca dca
+ * minimum longitudinal dca to reference point + * \li -max-ldca dca
+ * maximum longitudinal dca to reference point + * \li -min-tdca dca
+ * minimum transverse dca to reference point + * \li -max-tdca dca
+ * maximum transverse dca to reference point + * \li -etarange eta
+ * +/- eta range + * + * \li -binningVzero bins min max
+ * bins (Int_t), minBin (Float_t), maxBin (Float_t) + * \li -binningTpc bins min max
+ * bins (Int_t), minBin (Float_t), maxBin (Float_t) + * \li -binningZdc bins min max
+ * bins (Int_t), minBin (Float_t), maxBin (Float_t) + * \li -binningZnp bins min max
+ * bins (Int_t), minBin (Float_t), maxBin (Float_t) + * \li -binningZem bins min max
+ * bins (Int_t), minBin (Float_t), maxBin (Float_t) + * \li -binningCalo bins min max
+ * bins (Int_t), minBin (Float_t), maxBin (Float_t) + * + * \li -addTrigger TriggerClass beginning (eg CPBI1)
+ + *

Default CDB entries:

+ * + * + * HLT/ConfigGlobal/MultiplicityCorrelations + * \li -TObjString object holding a string with the configuration parameters + * currently empty + * + *

Performance:

+ * + *

Memory consumption:

+ * + *

Input size:

+ * + * + * \li pp: + * + *

Output size:

+ * + * + * \li pp: Average : + * + *

Macros Tests

+ * + * + * macros/makeConfigurationObjectMultiplicityCorrelations.C + * \li - Create configuration TObjString + * + * macros/HLTMultiplicityCorrelationsTest.C + * \li - Test macro for test in off-line environment + * + * macros/runMultiplicityCorrelationsTest.sh + * \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& 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 diff --git a/STEER/CMakelibSTEER.pkg b/STEER/CMakelibSTEER.pkg index 82bad97a591..f2c942e6b39 100644 --- a/STEER/CMakelibSTEER.pkg +++ b/STEER/CMakelibSTEER.pkg @@ -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 index 00000000000..981aaf142e0 --- /dev/null +++ b/STEER/STEER/AliHLTTestInputHandler.cxx @@ -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 index 00000000000..2e34f4592eb --- /dev/null +++ b/STEER/STEER/AliHLTTestInputHandler.h @@ -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 diff --git a/STEER/STEERLinkDef.h b/STEER/STEERLinkDef.h index d34148d8e09..69660544363 100644 --- a/STEER/STEERLinkDef.h +++ b/STEER/STEERLinkDef.h @@ -166,5 +166,6 @@ #pragma link C++ typedef AliLHCDipValC; #pragma link C++ class AliMCGenHandler+; +#pragma link C++ class AliHLTTestInputHandler+; #endif