-Moved PHOS Physics histogram producers to HLT/global/physics
authorslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 12 Feb 2010 15:50:32 +0000 (15:50 +0000)
committerslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 12 Feb 2010 15:50:32 +0000 (15:50 +0000)
-Reimplemented to use ESD input
-Added support for EMCAL

17 files changed:
HLT/PHOS/AliHLTPHOSHistoProdInvMass.cxx [deleted file]
HLT/PHOS/AliHLTPHOSHistoProdMatchedTracks.cxx [deleted file]
HLT/PHOS/AliHLTPHOSHistogramProducerComponent.cxx [deleted file]
HLT/PHOS/AliHLTPHOSHistogramProducerComponent.h [deleted file]
HLT/global/physics/AliHLTCaloHistoCellEnergy.cxx [moved from HLT/PHOS/AliHLTPHOSHistoProdCellEnergy.cxx with 56% similarity]
HLT/global/physics/AliHLTCaloHistoCellEnergy.h [moved from HLT/PHOS/AliHLTPHOSHistoProdCellEnergy.h with 68% similarity]
HLT/global/physics/AliHLTCaloHistoClusterEnergy.cxx [moved from HLT/PHOS/AliHLTPHOSHistoProdClusterEnergy.cxx with 51% similarity]
HLT/global/physics/AliHLTCaloHistoClusterEnergy.h [moved from HLT/PHOS/AliHLTPHOSHistoProdClusterEnergy.h with 61% similarity]
HLT/global/physics/AliHLTCaloHistoComponent.cxx [new file with mode: 0644]
HLT/global/physics/AliHLTCaloHistoComponent.h [new file with mode: 0644]
HLT/global/physics/AliHLTCaloHistoInvMass.cxx [new file with mode: 0644]
HLT/global/physics/AliHLTCaloHistoInvMass.h [moved from HLT/PHOS/AliHLTPHOSHistoProdInvMass.h with 73% similarity]
HLT/global/physics/AliHLTCaloHistoMatchedTracks.cxx [new file with mode: 0644]
HLT/global/physics/AliHLTCaloHistoMatchedTracks.h [moved from HLT/PHOS/AliHLTPHOSHistoProdMatchedTracks.h with 64% similarity]
HLT/global/physics/AliHLTV0HistoComponent.cxx
HLT/libAliHLTGlobal.pkg
HLT/libAliHLTPHOS.pkg

diff --git a/HLT/PHOS/AliHLTPHOSHistoProdInvMass.cxx b/HLT/PHOS/AliHLTPHOSHistoProdInvMass.cxx
deleted file mode 100644 (file)
index 176fa16..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project        * 
- * All rights reserved.                                                   *
- *                                                                        *
- * Primary Authors: Albin Gaignette
- *                                                                        *
- * 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   AliHLTPHOSHistoProdInvMass
- * @author Albin Gaignette
- * @date 
- * @brief  Histogram producer for PHOS HLT 
- */
-
-// 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 "AliHLTPHOSHistoProdInvMass.h"
-//#include "AliESDCaloCluster.h"
-#include "TMath.h"
-
-#include "AliHLTCaloClusterDataStruct.h"
-#include "AliHLTCaloClusterReader.h"
-#include "TObjArray.h"
-//#include "TClonesArray.h"
-//#include <iostream>
-#include "TH1F.h"
-//#include "TH2F.h"
-
-AliHLTPHOSHistoProdInvMass::AliHLTPHOSHistoProdInvMass() :
-  fClusterReader(NULL),
-  fHistTwoClusterInvMass(0),
-  fHistArrayPtr(0)
-{
-  // See header file for documentation
-  fHistArrayPtr = new TObjArray;
-  fClusterReader = new AliHLTCaloClusterReader();
-
-  fHistTwoClusterInvMass = new TH1F("fHistTwoClusterInvMass", "Invariant mass of two clusters", 200, 0, 1);
-  fHistTwoClusterInvMass->GetXaxis()->SetTitle("m_{#gamma#gamma} GeV");
-  fHistTwoClusterInvMass->GetYaxis()->SetTitle("Number of counts");
-  fHistTwoClusterInvMass->SetMarkerStyle(21);
-  fHistArrayPtr->AddLast(fHistTwoClusterInvMass);
-}
-
-AliHLTPHOSHistoProdInvMass::~AliHLTPHOSHistoProdInvMass()
-{
-  if(fHistTwoClusterInvMass)
-    {
-      delete fHistTwoClusterInvMass;
-      fHistTwoClusterInvMass = 0;
-    }
-}
-
-TObjArray* AliHLTPHOSHistoProdInvMass::GetHistograms()
-{  
-  // See header file for documentation
-
-  return fHistArrayPtr;
-}
-
-Int_t AliHLTPHOSHistoProdInvMass::DoEvent(AliHLTCaloClusterHeaderStruct* cHeader) {   
-  
-  fClusterReader->SetMemory(cHeader);
-  
-  int ncls = cHeader->fNClusters;
-  Float_t* cPos[ncls];
-  Float_t cEnergy[ncls];
-  
-  AliHLTCaloClusterDataStruct* cluster;
-  Int_t icls = 0;
-  while ( ( cluster = fClusterReader->NextCluster() ) ) {
-    
-    cPos[icls] = cluster->fGlobalPos;
-    cEnergy[icls] = cluster->fEnergy; 
-    
-    icls++;
-  }  
-  
-  for(Int_t ipho = 0; ipho<(ncls-1); ipho++) { 
-    for(Int_t jpho = ipho+1 ; jpho<ncls ; jpho++) { 
-      // Calcul of the theta angle between two photons
-      Double_t theta = (2* asin(0.5*TMath::Sqrt((cPos[ipho][0]-cPos[jpho][0])*(cPos[ipho][0]-cPos[jpho][0]) +(cPos[ipho][1]-cPos[jpho][1])*(cPos[ipho][1]-cPos[jpho][1]))/460));
-      
-      // Calcul of the mass m of the pion 
-      Double_t m =(TMath::Sqrt(2 * cEnergy[ipho]* cEnergy[jpho]*(1-TMath::Cos(theta))));
-      
-      fHistTwoClusterInvMass->Fill(m);
-    }
-  }
-  
-  return 0;
-}
-  
-
diff --git a/HLT/PHOS/AliHLTPHOSHistoProdMatchedTracks.cxx b/HLT/PHOS/AliHLTPHOSHistoProdMatchedTracks.cxx
deleted file mode 100644 (file)
index de60fef..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project        * 
- * All rights reserved.                                                   *
- *                                                                        *
- * Primary Authors: Albin Gaignette
- *                                                                        *
- * 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   AliHLTPHOSMatchedclustershistoProducer
- * @author Albin Gaignette
- * @date 
- * @brief  Histogram producer for PHOS HLT 
- */
-
-// 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 "AliHLTPHOSHistoProdMatchedTracks.h"
-//#include "AliESDCaloCluster.h"
-#include "TMath.h"
-
-#include "AliHLTCaloClusterDataStruct.h"
-#include "AliHLTCaloClusterReader.h"
-#include "TObjArray.h"
-//#include "TClonesArray.h"
-//#include <iostream>
-#include "TH1F.h"
-//#include "TH2F.h"
-
-AliHLTPHOSHistoProdMatchedTracks::AliHLTPHOSHistoProdMatchedTracks() :
-  fClusterReader(NULL),
-  fHistArrayPtr(0),
-  fHistMatchQuality(0),
-  fHistMatchedEnergy(0),
-  fHistUnMatchedEnergy(0)
-{
-  // See header file for documentation
-  fHistArrayPtr = new TObjArray;
-  fClusterReader = new AliHLTCaloClusterReader();
-
-  fHistMatchQuality = new TH1F("fHistMatchQuality", "Distance between cluster and track intersection with phos module", 50, 0, 50);
-  fHistMatchQuality->GetXaxis()->SetTitle("Distance (cm)");
-  fHistMatchQuality->GetYaxis()->SetTitle("Count");
-  fHistMatchQuality->SetMarkerStyle(21);
-  fHistArrayPtr->AddLast(fHistMatchQuality);
-
-  fHistMatchedEnergy = new  TH1F("fHistMatchedEnergy", "Energy distribution of clusters, negative x is unmatched, positive x is matched", 400, -200, 200);
-  fHistMatchedEnergy->GetXaxis()->SetTitle("Cluster Energy (GeV)");
-  fHistMatchedEnergy->GetYaxis()->SetTitle("Number of clusters. Negative x direction is unmatched track, positive matched");
-  fHistMatchedEnergy->SetMarkerStyle(21);
-  fHistArrayPtr->AddLast(fHistMatchedEnergy);
-
-  fHistUnMatchedEnergy = new  TH1F("fHistUnMatchedEnergy", "Energy distribution of clusters, negative x is unmatched, positive x is matched", 400, -200, 200);
-  fHistUnMatchedEnergy->GetXaxis()->SetTitle("Cluster Energy (GeV)");
-  fHistUnMatchedEnergy->GetYaxis()->SetTitle("Number of clusters. Negative x direction is unmatched track, positive matched");
-  fHistUnMatchedEnergy->SetMarkerStyle(21);
-  fHistArrayPtr->AddLast(fHistUnMatchedEnergy);
-}
-
-
-AliHLTPHOSHistoProdMatchedTracks::~AliHLTPHOSHistoProdMatchedTracks()
-{
-
-  if(fHistMatchQuality){
-    delete fHistMatchQuality;
-    fHistMatchQuality = 0;
-  }
-
-  if(fHistMatchedEnergy) {
-    delete fHistMatchedEnergy;
-    fHistMatchedEnergy = 0;
-  }
-
-  if(fHistUnMatchedEnergy) {
-    delete fHistUnMatchedEnergy;
-    fHistUnMatchedEnergy = 0;
-  }
-
-}
-
-
-TObjArray* AliHLTPHOSHistoProdMatchedTracks::GetHistograms()
-{  
-  // See header file for documentation
-
-  return fHistArrayPtr;
-}
-
-
-Int_t AliHLTPHOSHistoProdMatchedTracks::DoEvent(AliHLTCaloClusterHeaderStruct* cHeader) {   
-  
-  fClusterReader->SetMemory(cHeader);
-  
-  AliHLTCaloClusterDataStruct* cluster;
-  while ( ( cluster = fClusterReader->NextCluster() ) ) {
-    
-    if(cluster->fTracksMatched->GetSize()>0) {
-      fHistMatchedEnergy->Fill(cluster->fEnergy);
-    } else {
-      fHistUnMatchedEnergy->Fill(cluster->fEnergy);
-    }
-  }  
-  
-  
-  return 0;
-}
-  
-
diff --git a/HLT/PHOS/AliHLTPHOSHistogramProducerComponent.cxx b/HLT/PHOS/AliHLTPHOSHistogramProducerComponent.cxx
deleted file mode 100644 (file)
index 823358e..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-// $Id$
-
- /**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project        *
- * All rights reserved.                                                   *
- *                                                                        *
- * Primary Authors: Oystein Djuvsland                                     *
- *                                                                        *
- * 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 "AliHLTPHOSHistogramProducerComponent.h"
-#include "AliHLTPHOSProcessor.h"
-#include "TH1D.h"
-#include "TNtuple.h"
-#include "TFile.h"
-#include "AliHLTPHOSHistogramProducer.h"
-#include "AliHLTPHOSPhysicsHistogramProducer.h"
-#include "AliHLTPHOSCaloClusterContainerStruct.h"
-#include "TClonesArray.h"
-#include "AliHLTPHOSHistoProdCellEnergy.h"
-#include "AliHLTPHOSHistoProdClusterEnergy.h"
-#include "AliHLTPHOSHistoProdInvMass.h"
-#include "AliHLTPHOSHistoProdMatchedTracks.h"
-
-/** 
- * @file   AliHLTPHOSHistogramProducerComponent.cxx
- * @author Oystein Djuvsland
- * @date   
- * @brief  A histogram producer component for PHOS HLT
-*/
-
-// see below for class documentation
-// or
-// refer to README to build package
-// or
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-
-
-AliHLTPHOSHistogramProducerComponent gAliHLTPHOSHistogramProducerComponent;
-
-AliHLTPHOSHistogramProducerComponent::AliHLTPHOSHistogramProducerComponent() :
-  AliHLTPHOSProcessor(),
-  fPhysicsHistogramProducerPtr(0),
-  fPushModulo(1),
-  fCellEnergy(0),
-  fClusterEnergy(0),
-  fInvariantMass(0),
-  fMatchedTracks(0),
-  fCellEnergyHistProducer(0),
-  fClusterEnergyHistProducer(0),
-  fInvariantMassHistProducer(0),
-  fMatchedTracksHistProducer(0)
-
-{
-  //see header file for documentation
-}
-
-AliHLTPHOSHistogramProducerComponent::~AliHLTPHOSHistogramProducerComponent()
-{
-  //see header file for documentation
-}
-
-int 
-AliHLTPHOSHistogramProducerComponent::Deinit()
-{ 
-  //see header file for documentation
-  if(fPhysicsHistogramProducerPtr != 0)
-    {
-      delete fPhysicsHistogramProducerPtr;
-      fPhysicsHistogramProducerPtr = 0;
-    }
-
-  return 0;
-}
-
-const char*
-AliHLTPHOSHistogramProducerComponent::GetComponentID()
-{
-  //see header file for documentation
-  return "PhosHistoProducer";
-}
-
-
-void
-AliHLTPHOSHistogramProducerComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
-{ 
-  //see header file for documentation
-  list.clear();
-  list.push_back(AliHLTPHOSDefinitions::fgkESDCaloClusterDataType);
-  list.push_back(AliHLTPHOSDefinitions::fgkESDCaloCellsDataType);
-
-}
-
-AliHLTComponentDataType 
-AliHLTPHOSHistogramProducerComponent::GetOutputDataType()
-{
-  //see header file for documentation
-  return AliHLTPHOSDefinitions::fgkPhosHistDataType;
-}
-
-
-void 
-AliHLTPHOSHistogramProducerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
-{
-  //see header file for documentation
-  constBase = 30;
-  inputMultiplier = 5;
-}
-
-// int 
-// AliHLTPHOSHistogramProducerComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
-//                                     AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
-//                                     std::vector<AliHLTComponentBlockData>& outputBlocks)
-
-int 
-AliHLTPHOSHistogramProducerComponent::DoEvent(const AliHLTComponentEventData& /*evtData*/,
-                                             AliHLTComponentTriggerData& /*trigData*/)
-
-
-{
-  //see header file for documentation
-  for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeCaloCluster | kAliHLTDataOriginPHOS); pBlock!=NULL; pBlock=GetNextInputBlock()) 
-    {
-      AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr = reinterpret_cast<AliHLTCaloClusterHeaderStruct*>(pBlock->fPtr);
-      
-      if(fCellEnergy)
-       {
-         fCellEnergyHistProducer->DoEvent(caloClusterHeaderPtr);
-       }
-      if(fClusterEnergy)
-       {
-         fClusterEnergyHistProducer->DoEvent(caloClusterHeaderPtr);
-       }
-      if(fInvariantMass)
-       {
-         fInvariantMassHistProducer->DoEvent(caloClusterHeaderPtr);
-       }
-      if(fMatchedTracks)
-       {
-         fMatchedTracksHistProducer->DoEvent(caloClusterHeaderPtr);
-       }
-    }
-  if(fCellEnergy)
-    {
-      PushBack(fCellEnergyHistProducer->GetHistograms(), AliHLTPHOSDefinitions::fgkPhysicsHistogramsDataType);
-    }
-  if(fClusterEnergy)
-    {
-      PushBack(fClusterEnergyHistProducer->GetHistograms(), AliHLTPHOSDefinitions::fgkPhysicsHistogramsDataType);
-    }
-  if(fInvariantMass)
-    {
-      PushBack(fInvariantMassHistProducer->GetHistograms(), AliHLTPHOSDefinitions::fgkPhysicsHistogramsDataType);
-    }
-  if(fMatchedTracks)
-    {
-      PushBack(fMatchedTracksHistProducer->GetHistograms(), AliHLTPHOSDefinitions::fgkPhysicsHistogramsDataType);
-    }
-      
-  return 0;
-}
-
-
-int
-AliHLTPHOSHistogramProducerComponent::DoInit(int argc, const char** argv )
-{
-  //see header file for documentation
-
-   
-  for(int i = 0; i < argc; i++)
-    {
-      if(!strcmp("-cellenergy", argv[i+1])) fCellEnergy = true;
-      if(!strcmp("-clusterenergy", argv[i+1])) fClusterEnergy = true;
-      if(!strcmp("-invariantmass", argv[i+1])) fInvariantMass= true;
-      if(!strcmp("-matchedtracks", argv[i+1])) fMatchedTracks = true;
-    }
-  
-  if(fCellEnergy)
-    {
-      fCellEnergyHistProducer = new AliHLTPHOSHistoProdCellEnergy();
-    }
-  if(fClusterEnergy)
-    {
-      fClusterEnergyHistProducer = new AliHLTPHOSHistoProdClusterEnergy();
-    }
-  if(fInvariantMass)
-    {
-      fInvariantMassHistProducer = new AliHLTPHOSHistoProdInvMass();
-    }
-  if(fMatchedTracks)
-    {
-      fMatchedTracksHistProducer = new AliHLTPHOSHistoProdMatchedTracks();
-    }
-
-  return 0;
-}
-
-AliHLTComponent*
-AliHLTPHOSHistogramProducerComponent::Spawn()
-{
-  //see header file for documentation
-  return new AliHLTPHOSHistogramProducerComponent();
-}
-
diff --git a/HLT/PHOS/AliHLTPHOSHistogramProducerComponent.h b/HLT/PHOS/AliHLTPHOSHistogramProducerComponent.h
deleted file mode 100644 (file)
index 9ee6c07..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-//-*- Mode: C++ -*-
-// $Id$
-
-
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project        * 
- * All rights reserved.                                                   *
- *                                                                        *
- * Primary Authors: Oystein Djuvsland                                     *
- *                                                                        *
- * 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.                  *
- **************************************************************************/
-
-#ifndef ALIHLTPHOSHISTOGRAMPRODUCERCOMPONENT_H
-#define ALIHLTPHOSHISTOGRAMPRODUCERCOMPONENT_H
-
-
-
-/**
- * 
- *
- * @file   AliHLTPHOSHistogramProducerComponent.cxx
- * @author Oystein Djuvsland
- * @date   
- * @brief  
-*/
-
-// see below for class documentation
-// or
-// refer to README to build package
-// or
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-
-#include "AliHLTPHOSProcessor.h"
-
-class AliHLTPHOSPhysicsHistogramProducer;
-
-class AliHLTPHOSHistoProdCellEnergy;
-
-class AliHLTPHOSHistoProdClusterEnergy;
-
-class AliHLTPHOSHistoProdInvMass;
-
-class AliHLTPHOSHistoProdMatchedTracks;
-
-/**
- * @class AliHLTPHOSHistogramProducerComponent
- *
- * 
- * @ingroup alihlt_phos
- */
-class AliHLTPHOSHistogramProducerComponent: public AliHLTPHOSProcessor
-{
- public:
-
-  /** Constructor */
-  AliHLTPHOSHistogramProducerComponent();
-
-  /** Destructor */
-  virtual ~AliHLTPHOSHistogramProducerComponent();
-
-  /** Copy constructor */  
-  AliHLTPHOSHistogramProducerComponent(const AliHLTPHOSHistogramProducerComponent & ) : 
-    AliHLTPHOSProcessor(),
-    fPhysicsHistogramProducerPtr(0),
-    fPushModulo(0),
-    fCellEnergy(0),
-    fClusterEnergy(0),
-    fInvariantMass(0),
-    fMatchedTracks(0),
-    fCellEnergyHistProducer(0),
-    fClusterEnergyHistProducer(0),
-    fInvariantMassHistProducer(0),
-    fMatchedTracksHistProducer(0)
-
-  {
-    //Copy constructor not implemented
-  }
-  
-  /** Assignment */
-  AliHLTPHOSHistogramProducerComponent & operator = (const AliHLTPHOSHistogramProducerComponent)
-  {
-    //Assignment
-    return *this; 
-  }
-
-  /** interface function, see @ref AliHLTComponent for description */
-  const char* GetComponentID();
-
-  /** interface function, see @ref AliHLTComponent for description */
-  void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
-
-  /** interface function, see @ref AliHLTComponent for description */
-  AliHLTComponentDataType GetOutputDataType();
-
-  /** interface function, see @ref AliHLTComponent for description */
-  void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
-
-  /** interface function, see @ref AliHLTComponent for description */
-  
-  using  AliHLTPHOSProcessor::DoEvent;
-
-  int DoEvent(const AliHLTComponentEventData& evtData, 
-             AliHLTComponentTriggerData& trigData);
-    
-  // Int_t DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
-  /** interface function, see @ref AliHLTComponent for description */
-  AliHLTComponent* Spawn();
-  
-protected:
-
-  /** interface function, see @ref AliHLTComponent for description */
-  int DoInit(int argc, const char** argv);
-
-  /** interface function, see @ref AliHLTComponent for description */
-  int Deinit();
-
- private:
-
-  AliHLTPHOSPhysicsHistogramProducer* fPhysicsHistogramProducerPtr;
-  UInt_t fPushModulo;
-  
-  
-  Bool_t fCellEnergy; // make the cell energy histograms?
-  Bool_t fClusterEnergy; // make the cluster energy histograms?
-  Bool_t fInvariantMass; // make the invariant mass histograms?
-  Bool_t fMatchedTracks; // make the matched tracks histograms?
-  
-  AliHLTPHOSHistoProdCellEnergy *fCellEnergyHistProducer; // cell energy histogram producer
-
-  AliHLTPHOSHistoProdClusterEnergy *fClusterEnergyHistProducer; // cluster energy histogram producer
-
-  AliHLTPHOSHistoProdInvMass *fInvariantMassHistProducer; // invariant mass histogram producer
-
-  AliHLTPHOSHistoProdMatchedTracks *fMatchedTracksHistProducer; // matched tracks histogram producer
-
-};
-
-#endif
@@ -1,9 +1,8 @@
-
 /**************************************************************************
  * This file is property of and copyright by the ALICE HLT Project        * 
  * All rights reserved.                                                   *
  *                                                                        *
- * Primary Authors: Albin Gaignette
+ * Primary Authors: Albin Gaignette, Svein Lindal slindal@fys.uio.no      *
  *                                                                        *
  * Permission to use, copy, modify and distribute this software and its   *
  * documentation strictly for non-commercial purposes is hereby granted   *
@@ -15,8 +14,8 @@
  **************************************************************************/
 
 /** 
- * @file   AliHLTPHOSHistoProdCellEnergy
- * @author Albin Gaignette & Svein Lindal
+ * @file   AliHLTCaloHistoCellEnergy
+ * @author Svein Lindal
  * @date 
  * @brief  Produces histograms of cluster energy distributions 
  */
 // or
 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
 
-#include "AliHLTPHOSHistoProdCellEnergy.h"
-//#include "AliESDCaloCluster.h"
-#include "TMath.h"
-
-#include "AliHLTCaloClusterDataStruct.h"
-#include "AliHLTCaloClusterReader.h"
+#include "AliHLTCaloHistoCellEnergy.h"
 #include "TObjArray.h"
-//#include "TClonesArray.h"
-//#include <iostream>
 #include "TH1F.h"
 #include "TH2F.h"
+#include "TRefArray.h"
+#include "TString.h"
+#include "AliESDCaloCluster.h"
 
-AliHLTPHOSHistoProdCellEnergy::AliHLTPHOSHistoProdCellEnergy() :
-  fClusterReader(NULL),
+ClassImp(AliHLTCaloHistoCellEnergy);
+
+AliHLTCaloHistoCellEnergy::AliHLTCaloHistoCellEnergy(TString det) :
   fHistCellEnergy(NULL),
   fHistCellEnergyVsNCells(NULL),
   fHistArrayPtr(NULL)
 {
   // See header file for documentation
   fHistArrayPtr = new TObjArray;
-  fClusterReader = new AliHLTCaloClusterReader();
 
-  fHistCellEnergy = new TH1F("fHistCellEnergy", "Distribution of total energy in clusters", 200, 0, 1);
+  fHistCellEnergy = new TH1F(Form("%s fHistCellEnergy", det.Data()), Form("%s Distribution of total energy in clusters", det.Data()), 200, 0, 1);
   fHistCellEnergy->GetXaxis()->SetTitle("E GeV");
   fHistCellEnergy->GetYaxis()->SetTitle("Number of counts");
   fHistCellEnergy->SetMarkerStyle(21);
   fHistArrayPtr->AddLast(fHistCellEnergy);
 
-  fHistCellEnergyVsNCells = new TH2F("fHistCellEnergyVsNCells", "Distribution of Energy vs Number of Cells in cluster", 200, 0, 200, 50, 0 , 50);
+  fHistCellEnergyVsNCells = new TH2F(Form("%s fHistCellEnergyVsNCells", det.Data()), Form("%s Distribution of Energy vs Number of Cells in cluster", det.Data()), 200, 0, 200, 50, 0 , 50);
   fHistCellEnergyVsNCells->GetXaxis()->SetTitle("Energy in cluster (GeV)");
   fHistCellEnergyVsNCells->GetYaxis()->SetTitle("Number of Cells in cluster");
   fHistCellEnergyVsNCells->SetMarkerStyle(21);
   fHistArrayPtr->AddLast(fHistCellEnergyVsNCells);
 
-
 }
 
-AliHLTPHOSHistoProdCellEnergy::~AliHLTPHOSHistoProdCellEnergy()
+AliHLTCaloHistoCellEnergy::~AliHLTCaloHistoCellEnergy()
 {
-  if(fHistCellEnergy){
-      delete fHistCellEnergy;
-      fHistCellEnergy = 0;
-    }
+  //See header file for documentation
+
+  if(fHistCellEnergy)
+    delete fHistCellEnergy;
+  fHistCellEnergy = NULL;
+  
+  if(fHistCellEnergyVsNCells)
+    delete fHistCellEnergyVsNCells;
+  fHistCellEnergyVsNCells = NULL;
+
+  if(fHistArrayPtr)
+    delete fHistArrayPtr;
+  fHistArrayPtr = NULL;
+
 }
 
-TObjArray* AliHLTPHOSHistoProdCellEnergy::GetHistograms()
+TObjArray* AliHLTCaloHistoCellEnergy::GetHistograms()
 {  
   // See header file for documentation
-
   return fHistArrayPtr;
 }
 
-Int_t AliHLTPHOSHistoProdCellEnergy::DoEvent(AliHLTCaloClusterHeaderStruct* cHeader) {   
+
+Int_t AliHLTCaloHistoCellEnergy::FillHistograms(Int_t nc, TRefArray * clustersArray) {   
   
-  fClusterReader->SetMemory(cHeader);
-  AliHLTCaloClusterDataStruct* cluster;
-  while ( ( cluster = fClusterReader->NextCluster() ) ) {
-    fHistCellEnergy->Fill(cluster->fNCells);
-    fHistCellEnergyVsNCells->Fill(cluster->fNCells, cluster->fCellsAmpFraction);
+  for(int ic = 0; ic < nc; ic++) {
+    AliESDCaloCluster * cluster = static_cast<AliESDCaloCluster*>(clustersArray->At(ic));
+    for(int i = 0; i < cluster->GetNCells(); i++) {
+      fHistCellEnergyVsNCells->Fill(cluster->GetNCells(), cluster->GetCellAmplitudeFraction(i));
+      fHistCellEnergy->Fill(cluster->GetCellAmplitudeFraction(i));
+    }
   }  
+  
   return 0;
 }
   
similarity index 68%
rename from HLT/PHOS/AliHLTPHOSHistoProdCellEnergy.h
rename to HLT/global/physics/AliHLTCaloHistoCellEnergy.h
index 822da30..dac3c5a 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-#ifndef ALIHLTPHOSHISTOPRODCELLENERGY
-#define ALIHLTPHOSHISTOPRODCELLENERGY
+#ifndef ALIHLTCALOHISTOCELLENERGY
+#define ALIHLTCALOHISTOCELLENERGY
 
 /** 
- * @file   AliHLTPHOSHistoProdCellEnergy
- * @author Albin Gaignette and Svein Lindal slindal@fys.uio.no
+ * @file   AliHLTCaloHistoCellEnergy
+ * @author Svein Lindal <slindal@fys.uio.no>
  * @date 
  * @brief  Produces Invariant mass histograms of PHOS clusters
  */
 //#include "AliHLTPHOSBase.h"
 
 #include "Rtypes.h"
-#include "AliHLTPHOSConstant.h" 
 
 class TObjArray;
 class TH1F;
 class TH2F;
-class AliHLTCaloClusterReader;
-struct AliHLTCaloClusterHeaderStruct;
-
-
-using namespace  PhosHLTConst;
+class TRefArray;
+class TString;
 
 
 /** 
- * @class AliHLTPHOSHistoProdCellEnergy
+ * @class AliHLTCaloHistoCellEnergy
  *
  * Class produces physics histograms for PHOS. It takes a TClonesArray
  * of AliESDCalocluster as input and fills several histograms
@@ -56,45 +52,38 @@ using namespace  PhosHLTConst;
  * @ingroup alihlt_phos
  */
 
-class AliHLTPHOSHistoProdCellEnergy 
+
+
+
+
+class AliHLTCaloHistoCellEnergy 
 {
  public:
   
   /** Constructor */
-  AliHLTPHOSHistoProdCellEnergy();
+  AliHLTCaloHistoCellEnergy(TString det);
 
   /** Destructor */
-  virtual ~AliHLTPHOSHistoProdCellEnergy();
-
-  /** Copy constructor */
-  AliHLTPHOSHistoProdCellEnergy(const AliHLTPHOSHistoProdCellEnergy &) :
-    fClusterReader(NULL),
-    fHistCellEnergy(NULL),
-    fHistCellEnergyVsNCells(NULL),
-    fHistArrayPtr(NULL)
-  {
-    // Copy constructor not implemented
-  }
-
-  /** Assignment operator */
-  AliHLTPHOSHistoProdCellEnergy & operator= (const AliHLTPHOSHistoProdCellEnergy)
-  {
-    // assignment
-    return *this;
-  }
+  virtual ~AliHLTCaloHistoCellEnergy();
 
   /** Analyse the clusters in the event */
-  int DoEvent(AliHLTCaloClusterHeaderStruct* cHeader);
-
+  Int_t FillHistograms(Int_t nc, TRefArray * clustersArray);
+  
   /** Get a pointer to the TObjArray of histograms */
   TObjArray *GetHistograms();
 
   
   
  private:
+  
+  /** Default constructor prohibited */
+  AliHLTCaloHistoCellEnergy();
+
+  /** Copy constructor prohibited*/
+  AliHLTCaloHistoCellEnergy(const AliHLTCaloHistoCellEnergy &);
 
-  /** Cluster reader class   */
-  AliHLTCaloClusterReader * fClusterReader;
+  /** Assignment operator prohibited*/
+  AliHLTCaloHistoCellEnergy & operator= (const AliHLTCaloHistoCellEnergy);
 
   /** Histogram of the 2 cluster invariant mass */
   TH1F *fHistCellEnergy;                 //!transient
@@ -105,7 +94,7 @@ class AliHLTPHOSHistoProdCellEnergy
   /** Pointer to the array of histograms */
   TObjArray *fHistArrayPtr;                     //!transient
 
-  ClassDef(AliHLTPHOSHistoProdCellEnergy, 0);
+  ClassDef(AliHLTCaloHistoCellEnergy, 1);
 
 };
  
@@ -1,9 +1,8 @@
-
 /**************************************************************************
  * This file is property of and copyright by the ALICE HLT Project        * 
  * All rights reserved.                                                   *
  *                                                                        *
- * Primary Authors: Albin Gaignette
+ * Primary Authors: Svein Lindal <slindal@fys.uio.no>    *
  *                                                                        *
  * Permission to use, copy, modify and distribute this software and its   *
  * documentation strictly for non-commercial purposes is hereby granted   *
@@ -15,8 +14,8 @@
  **************************************************************************/
 
 /** 
- * @file   AliHLTPHOSHistoProdClusterEnergy
- * @author Albin Gaignette & Svein Lindal
+ * @file   AliHLTCaloHistoClusterEnergy
+ * @author Svein Lindal
  * @date 
  * @brief  Produces histograms of cluster energy distributions 
  */
 // or
 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
 
-#include "AliHLTPHOSHistoProdClusterEnergy.h"
-//#include "AliESDCaloCluster.h"
+#include "AliHLTCaloHistoClusterEnergy.h"
+#include "AliESDCaloCluster.h"
 #include "TMath.h"
-
-#include "AliHLTCaloClusterDataStruct.h"
-#include "AliHLTCaloClusterReader.h"
 #include "TObjArray.h"
-//#include "TClonesArray.h"
-//#include <iostream>
 #include "TH1F.h"
 #include "TH2F.h"
+#include "TRefArray.h"
+
 
-AliHLTPHOSHistoProdClusterEnergy::AliHLTPHOSHistoProdClusterEnergy() :
-  fClusterReader(NULL),
+ClassImp(AliHLTCaloHistoClusterEnergy);
+
+AliHLTCaloHistoClusterEnergy::AliHLTCaloHistoClusterEnergy(TString det) :
   fHistClusterEnergy(NULL),
   fHistClusterEnergyVsNCells(NULL),
   fHistArrayPtr(NULL)
 {
   // See header file for documentation
   fHistArrayPtr = new TObjArray;
-  fClusterReader = new AliHLTCaloClusterReader();
 
-  fHistClusterEnergy = new TH1F("fHistClusterEnergy", "Distribution of total energy in clusters", 200, 0, 1);
+  fHistClusterEnergy = new TH1F(Form("%s fHistClusterEnergy", det.Data()), Form("%s Distribution of total energy in clusters", det.Data()), 200, 0, 1);
   fHistClusterEnergy->GetXaxis()->SetTitle("E GeV");
   fHistClusterEnergy->GetYaxis()->SetTitle("Number of counts");
   fHistClusterEnergy->SetMarkerStyle(21);
   fHistArrayPtr->AddLast(fHistClusterEnergy);
 
-  fHistClusterEnergyVsNCells = new TH2F("fHistClusterEnergyVsNCells", "Distribution of Energy vs Number of Cells in cluster", 200, 0, 200, 50, 0 , 50);
+  fHistClusterEnergyVsNCells = new TH2F(Form("%s fHistClusterEnergyVsNCells", det.Data()), Form("%s Distribution of Energy vs Number of Cells in cluster", det.Data()), 200, 0, 200, 50, 0 , 50);
   fHistClusterEnergyVsNCells->GetXaxis()->SetTitle("Energy in cluster (GeV)");
   fHistClusterEnergyVsNCells->GetYaxis()->SetTitle("Number of Cells in cluster");
   fHistClusterEnergyVsNCells->SetMarkerStyle(21);
   fHistArrayPtr->AddLast(fHistClusterEnergyVsNCells);
 
-
 }
 
-AliHLTPHOSHistoProdClusterEnergy::~AliHLTPHOSHistoProdClusterEnergy()
+AliHLTCaloHistoClusterEnergy::~AliHLTCaloHistoClusterEnergy()
 {
-  if(fHistClusterEnergy){
-      delete fHistClusterEnergy;
-      fHistClusterEnergy = 0;
-    }
+  if(fHistClusterEnergy)
+    delete fHistClusterEnergy;
+  fHistClusterEnergy = NULL;
+
+  if(fHistClusterEnergyVsNCells)
+    delete fHistClusterEnergyVsNCells;
+  fHistClusterEnergyVsNCells = NULL;
+
+
+  
+  if(fHistArrayPtr)
+    delete fHistArrayPtr;
+  fHistArrayPtr = NULL;
+
+
 }
 
-TObjArray* AliHLTPHOSHistoProdClusterEnergy::GetHistograms()
-{  
+TObjArray* AliHLTCaloHistoClusterEnergy::GetHistograms() {  
   // See header file for documentation
-
   return fHistArrayPtr;
 }
 
-Int_t AliHLTPHOSHistoProdClusterEnergy::DoEvent(AliHLTCaloClusterHeaderStruct* cHeader) {   
-  
-  fClusterReader->SetMemory(cHeader);
-  
-  int ncls = cHeader->fNClusters;
-  Float_t* cPos[ncls];
-  Float_t cEnergy[ncls];
+Int_t AliHLTCaloHistoClusterEnergy::FillHistograms(Int_t nc, TRefArray * clustersArray) {
   
-  AliHLTCaloClusterDataStruct* cluster;
-  Int_t icls = 0;
-  while ( ( cluster = fClusterReader->NextCluster() ) ) {
-    
-    cPos[icls] = cluster->fGlobalPos;
-    cEnergy[icls] = cluster->fEnergy; 
-    
-    icls++;
-  }  
-  
-  for(Int_t ipho = 0; ipho<(ncls-1); ipho++) { 
-    for(Int_t jpho = ipho+1 ; jpho<ncls ; jpho++) { 
-      // Calcul of the theta angle between two photons
-      Double_t theta = (2* asin(0.5*TMath::Sqrt((cPos[ipho][0]-cPos[jpho][0])*(cPos[ipho][0]-cPos[jpho][0]) +(cPos[ipho][1]-cPos[jpho][1])*(cPos[ipho][1]-cPos[jpho][1]))/460));
-      
-      // Calcul of the mass m of the pion 
-      Double_t m =(TMath::Sqrt(2 * cEnergy[ipho]* cEnergy[jpho]*(1-TMath::Cos(theta))));
-      
-      fHistClusterEnergy->Fill(m);
-    }
+  for(int ic = 0; ic < nc; ic++) {
+    AliESDCaloCluster * cluster = static_cast<AliESDCaloCluster*>(clustersArray->At(ic));
+    fHistClusterEnergy->Fill(cluster->E());
+    fHistClusterEnergyVsNCells->Fill(cluster->GetNCells(), cluster->E());
   }
   
-  return 0;
-}
   
-
+}
@@ -2,7 +2,7 @@
  * This file is property of and copyright by the ALICE HLT Project        * 
  * All rights reserved.                                                   *
  *                                                                        *
- * Primary Authors: Albin Gaignette                                       *
+ * Primary Authors: Svein Lindal                                          *
  *                                                                        *
  * Permission to use, copy, modify and distribute this software and its   *
  * documentation strictly for non-commercial purposes is hereby granted   *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-#ifndef ALIHLTPHOSHISTOPRODCLUSTERENERGY
-#define ALIHLTPHOSHISTOPRODCLUSTERENERGY
+#ifndef ALIHLTCALOHISTOCLUSTERENERGY
+#define ALIHLTCALOHISTOCLUSTERENERGY
 
 /** 
- * @file   AliHLTPHOSHistoProdClusterEnergy
+ * @file   AliHLTCaloHistoClusterEnergy
  * @author Albin Gaignette and Svein Lindal slindal@fys.uio.no
  * @date 
  * @brief  Produces Invariant mass histograms of PHOS clusters
 //#include "AliHLTPHOSBase.h"
 
 #include "Rtypes.h"
-#include "AliHLTPHOSConstants.h" 
 
 class TObjArray;
 class TH1F;
 class TH2F;
-class AliHLTCaloClusterReader;
-struct AliHLTCaloClusterHeaderStruct;
-
-
-using namespace  PhosHLTConst;
+class AliESDEvent;
+class TRefArray;
+class TString;
 
 
 /** 
- * @class AliHLTPHOSHistoProdClusterEnergy
+ * @class AliHLTCaloHistoClusterEnergy
  *
  * Class produces physics histograms for PHOS. It takes a TClonesArray
  * of AliESDCalocluster as input and fills several histograms
@@ -56,35 +53,18 @@ using namespace  PhosHLTConst;
  * @ingroup alihlt_phos
  */
 
-class AliHLTPHOSHistoProdClusterEnergy 
-{
- public:
+class AliHLTCaloHistoClusterEnergy {
+public:
   
   /** Constructor */
-  AliHLTPHOSHistoProdClusterEnergy();
-
+  AliHLTCaloHistoClusterEnergy(TString det);
+  
   /** Destructor */
-  virtual ~AliHLTPHOSHistoProdClusterEnergy();
-
-  /** Copy constructor */
-  AliHLTPHOSHistoProdClusterEnergy(const AliHLTPHOSHistoProdClusterEnergy &) :
-    fClusterReader(NULL),
-    fHistClusterEnergy(NULL),
-    fHistClusterEnergyVsNCells(NULL),
-    fHistArrayPtr(NULL)
-  {
-    // Copy constructor not implemented
-  }
-
-  /** Assignment operator */
-  AliHLTPHOSHistoProdClusterEnergy & operator= (const AliHLTPHOSHistoProdClusterEnergy)
-  {
-    // assignment
-    return *this;
-  }
-
-  /** Analyse the clusters in the event */
-  int DoEvent(AliHLTCaloClusterHeaderStruct* cHeader);
+  virtual ~AliHLTCaloHistoClusterEnergy();
+
+  /** Analyse the clusters in the event and fill histograms */
+  Int_t FillHistograms(Int_t nc, TRefArray * clustersArray);
 
   /** Get a pointer to the TObjArray of histograms */
   TObjArray *GetHistograms();
@@ -93,19 +73,25 @@ class AliHLTPHOSHistoProdClusterEnergy
   
  private:
 
-  /** Cluster reader class   */
-  AliHLTCaloClusterReader * fClusterReader;
+  /** Default constructor prohibited*/
+  AliHLTCaloHistoClusterEnergy();
+
+  /** Copy constructor prohibited */
+  AliHLTCaloHistoClusterEnergy(const AliHLTCaloHistoClusterEnergy &);
+
+  /** Assignment operator prohibited */
+  AliHLTCaloHistoClusterEnergy & operator= (const AliHLTCaloHistoClusterEnergy);
 
   /** Histogram of the 2 cluster invariant mass */
-  TH1F *fHistClusterEnergy;                 //!transient
+  TH1F * fHistClusterEnergy;                 //!transient
 
   /** 2D histogram of cluster energy vs the number of cells in the cluster */
-  TH2F *fHistClusterEnergyVsNCells;
+  TH2F * fHistClusterEnergyVsNCells;
   
   /** Pointer to the array of histograms */
   TObjArray *fHistArrayPtr;                     //!transient
 
-  ClassDef(AliHLTPHOSHistoProdClusterEnergy, 0);
+  ClassDef(AliHLTCaloHistoClusterEnergy, 1);
 
 };
  
diff --git a/HLT/global/physics/AliHLTCaloHistoComponent.cxx b/HLT/global/physics/AliHLTCaloHistoComponent.cxx
new file mode 100644 (file)
index 0000000..e439119
--- /dev/null
@@ -0,0 +1,336 @@
+//-*- Mode: C++ -*-
+ /**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project        *
+ * All rights reserved.                                                   *
+ *                                                                        *
+ * Primary Authors: Svein Lindal, Oeystein Djuvsland                      * 
+ * 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   AliHLTCaloHistoComponent.cxx
+ * @author Svein Lindal
+ * @date   
+ * @brief  A physics histogram producer component for Calo HLT
+*/
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
+
+
+#include "AliHLTCaloHistoComponent.h"
+#include "AliHLTCaloHistoCellEnergy.h"
+#include "AliHLTCaloHistoClusterEnergy.h"
+#include "AliHLTCaloHistoInvMass.h"
+#include "AliHLTCaloHistoMatchedTracks.h"
+#include "AliESDEvent.h"
+#include "TRefArray.h"
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+
+ClassImp(AliHLTCaloHistoComponent);
+
+AliHLTCaloHistoComponent::AliHLTCaloHistoComponent() :
+  AliHLTProcessor(),
+  fEmcalClustersArray(NULL),
+  fPhosClustersArray(NULL),
+  fDoPhos(kFALSE), 
+  fDoEmcal(kFALSE),
+  fDoCellEnergy(kFALSE),
+  fDoClusterEnergy(kFALSE),
+  fDoInvariantMass(kFALSE),
+  fDoMatchedTracks(kFALSE),
+  fPhosCellEnergyHistProducer(NULL),
+  fEmcalCellEnergyHistProducer(NULL),
+  fPhosClusterEnergyHistProducer(NULL),
+  fEmcalClusterEnergyHistProducer(NULL),
+  fPhosInvariantMassHistProducer(NULL),
+  fEmcalInvariantMassHistProducer(NULL),
+  fPhosMatchedTracksHistProducer(NULL),
+  fEmcalMatchedTracksHistProducer(NULL)
+{
+  //see header file for documentation
+}
+
+AliHLTCaloHistoComponent::~AliHLTCaloHistoComponent() 
+{
+  //see header file for documentation
+  //Deinit();
+}
+
+Int_t AliHLTCaloHistoComponent::DoInit(int argc, const char** argv ) {
+  //see header file for documentation
+  
+
+  
+  for(int i = 0; i < argc; i++) {
+    if(!strcmp("-cellenergy", argv[i+1])) fDoCellEnergy = true;
+    if(!strcmp("-clusterenergy", argv[i+1])) fDoClusterEnergy = true;
+    if(!strcmp("-invariantmass", argv[i+1])) fDoInvariantMass= true;
+    if(!strcmp("-matchedtracks", argv[i+1])) fDoMatchedTracks = true;
+    if(!strcmp("-phos", argv[i+1])) fDoPhos = true;
+    if(!strcmp("-emcal", argv[i+1])) fDoEmcal = true;
+  }
+
+  
+  
+  //PHOS
+  if(fDoPhos){
+
+    fPhosClustersArray = new TRefArray();
+    
+    if(fDoInvariantMass) 
+      fPhosInvariantMassHistProducer = new AliHLTCaloHistoInvMass("PHOS");
+    
+    
+    if(fDoMatchedTracks)
+      fPhosMatchedTracksHistProducer = new AliHLTCaloHistoMatchedTracks("PHOS");
+  
+  
+    if(fDoClusterEnergy)
+      fPhosClusterEnergyHistProducer = new AliHLTCaloHistoClusterEnergy("PHOS");
+  
+  
+    if(fDoCellEnergy) 
+      fPhosCellEnergyHistProducer = new AliHLTCaloHistoCellEnergy("PHOS");
+
+  }
+  
+
+  //EMCAL
+  if(fDoEmcal) {
+
+    fEmcalClustersArray = new TRefArray();
+  
+    if(fDoInvariantMass)
+      fEmcalInvariantMassHistProducer = new AliHLTCaloHistoInvMass("EMCAL");
+
+    
+    if(fDoMatchedTracks)
+      fEmcalMatchedTracksHistProducer = new AliHLTCaloHistoMatchedTracks("EMCAL");
+
+  
+    if(fDoClusterEnergy)
+      fEmcalClusterEnergyHistProducer = new AliHLTCaloHistoClusterEnergy("EMCAL");
+    
+
+    if(fDoCellEnergy) 
+      fEmcalCellEnergyHistProducer = new AliHLTCaloHistoCellEnergy("EMCAL");
+    
+  }
+  
+  return 0;
+}
+
+
+Int_t AliHLTCaloHistoComponent::DoDeinit()
+{ 
+  //see header file for documentation
+
+
+  //Clusters Arrays
+  if(fEmcalClustersArray)
+    delete fEmcalClustersArray;
+  fEmcalClustersArray = NULL;
+
+  if(fPhosClustersArray)
+    delete fPhosClustersArray;
+  fPhosClustersArray = NULL;
+
+
+  //CellEnergy
+  if(fPhosCellEnergyHistProducer)
+    delete fPhosCellEnergyHistProducer;
+  fPhosCellEnergyHistProducer = NULL;
+
+
+  if(fEmcalCellEnergyHistProducer)
+    delete fEmcalCellEnergyHistProducer;
+  fEmcalCellEnergyHistProducer = NULL;
+
+
+  //ClusterEnergy
+  if(fPhosClusterEnergyHistProducer)
+    delete fPhosClusterEnergyHistProducer;
+  fPhosClusterEnergyHistProducer = NULL;
+
+  if(fEmcalClusterEnergyHistProducer)
+    delete fEmcalClusterEnergyHistProducer;
+  fEmcalClusterEnergyHistProducer = NULL;
+
+
+  //Invariant mass histogram producers
+  if(fPhosInvariantMassHistProducer)
+    delete  fPhosInvariantMassHistProducer;
+  fPhosInvariantMassHistProducer = NULL;
+
+  if(fEmcalInvariantMassHistProducer)
+    delete  fEmcalInvariantMassHistProducer;
+  fEmcalInvariantMassHistProducer = NULL;
+
+
+  //Matched track histogram producers
+  if(fEmcalMatchedTracksHistProducer)
+    delete fEmcalMatchedTracksHistProducer;
+  fEmcalMatchedTracksHistProducer = NULL;
+
+  if(fPhosMatchedTracksHistProducer)
+    delete fPhosMatchedTracksHistProducer;
+  fPhosMatchedTracksHistProducer = NULL;
+
+
+  return 0;
+}
+
+const char* AliHLTCaloHistoComponent::GetComponentID()
+{
+  //see header file for documentation
+  return "CaloPhysicsHistos";
+}
+
+
+void
+AliHLTCaloHistoComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
+{ 
+  //see header file for documentation
+  list.clear();
+  list.push_back( kAliHLTDataTypeESDObject|kAliHLTDataOriginOut );
+  //   list.push_back(AliHLTPHOSDefinitions::fgkClusterDataType);
+//   list.push_back(AliHLTPHOSDefinitions::fgkESDCaloClusterDataType);
+//   list.push_back(AliHLTPHOSDefinitions::fgkESDCaloCellsDataType);
+
+}
+
+AliHLTComponentDataType AliHLTCaloHistoComponent::GetOutputDataType()
+{
+  //see header file for documentation
+  return kAliHLTDataTypeHistogram  | kAliHLTDataOriginOut;
+}
+
+
+void AliHLTCaloHistoComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
+{
+  //see header file for documentation
+  constBase = 30;
+  inputMultiplier = 5;
+}
+
+AliHLTComponent* AliHLTCaloHistoComponent::Spawn() {
+  //see header file for documentation
+  return new AliHLTCaloHistoComponent();
+}
+
+Int_t AliHLTCaloHistoComponent::DoEvent(const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/) {
+
+  //see header file for documentation
+  if ( GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR ) )
+    return 0;
+  
+//   if( fUID == 0 ){
+//     TTimeStamp t;
+//     fUID = ( gSystem->GetPid() + t.GetNanoSec())*10 + evtData.fEventID;
+//   }
+
+
+  for ( const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDObject); iter != NULL; iter = GetNextInputObject() ) {
+    AliESDEvent *event = dynamic_cast<AliESDEvent*>(const_cast<TObject*>( iter ) );
+
+    
+    //EMCAL
+    if(fDoEmcal){
+      Int_t nec = event->GetEMCALClusters(fEmcalClustersArray);
+      
+      if(fDoMatchedTracks)
+       fEmcalMatchedTracksHistProducer->FillHistograms(nec, fEmcalClustersArray);
+      
+      if(fDoInvariantMass)
+       fEmcalInvariantMassHistProducer->FillHistograms(nec, fEmcalClustersArray);
+    
+      if(fDoClusterEnergy)
+       fEmcalClusterEnergyHistProducer->FillHistograms(nec, fEmcalClustersArray);
+   
+      if(fDoCellEnergy)
+       fEmcalCellEnergyHistProducer->FillHistograms(nec, fEmcalClustersArray);;
+   
+    }
+
+
+    //PHOS
+    if(fDoPhos){
+      
+      Int_t npc = event->GetPHOSClusters(fPhosClustersArray);
+      
+      if(fDoMatchedTracks)
+       fPhosMatchedTracksHistProducer->FillHistograms(npc, fPhosClustersArray);
+      
+      if(fDoInvariantMass)
+       fPhosInvariantMassHistProducer->FillHistograms(npc, fPhosClustersArray);
+
+      if(fDoClusterEnergy)
+       fPhosClusterEnergyHistProducer->FillHistograms(npc, fPhosClustersArray);
+
+      if(fDoCellEnergy)
+       fPhosCellEnergyHistProducer->FillHistograms(npc, fPhosClustersArray);
+   
+    }
+      
+  }
+
+  
+  //Push histos
+  
+  //PHOS
+  if(fDoPhos){
+    
+    if(fDoInvariantMass)
+      PushBack(fPhosInvariantMassHistProducer->GetHistograms(), kAliHLTDataTypeHistogram);
+    
+    if(fDoMatchedTracks)
+      PushBack(fPhosMatchedTracksHistProducer->GetHistograms(), kAliHLTDataTypeHistogram);
+
+    if(fDoClusterEnergy) 
+      PushBack(fPhosClusterEnergyHistProducer->GetHistograms(), kAliHLTDataTypeHistogram);
+
+    if(fDoCellEnergy)
+      PushBack(fPhosCellEnergyHistProducer->GetHistograms(), kAliHLTDataTypeHistogram);
+    
+  }
+
+  //EMCAL
+  if(fDoEmcal) {
+
+    if(fDoInvariantMass) 
+      PushBack(fEmcalInvariantMassHistProducer->GetHistograms(), kAliHLTDataTypeHistogram);
+        
+    if(fDoMatchedTracks) 
+      PushBack(fEmcalMatchedTracksHistProducer->GetHistograms(), kAliHLTDataTypeHistogram);
+  
+    if(fDoClusterEnergy) 
+      PushBack(fEmcalClusterEnergyHistProducer->GetHistograms(), kAliHLTDataTypeHistogram);
+    
+    if(fDoCellEnergy)
+      PushBack(fEmcalCellEnergyHistProducer->GetHistograms(), kAliHLTDataTypeHistogram);
+    
+  }
+
+  return 0;
+
+}
+
+
+
+
diff --git a/HLT/global/physics/AliHLTCaloHistoComponent.h b/HLT/global/physics/AliHLTCaloHistoComponent.h
new file mode 100644 (file)
index 0000000..a773559
--- /dev/null
@@ -0,0 +1,122 @@
+//-*- Mode: C++ -*-
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * All rights reserved.                                                   *
+ *                                                                        *
+ * Primary Authors: Oystein Djuvsland, Svein Lindal                       *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+#ifndef ALIHLTCALOHISTOCOMPONENT_H
+#define ALIHLTCALOHISTOCOMPONENT_H
+
+/**
+ * 
+ *
+ * @file   AliHLTCaloHistoComponent.cxx
+ * @author Svein Lindal
+ * @date   
+ * @brief  
+*/
+
+// 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"
+
+#include "Rtypes.h"
+
+class AliHLTPHOSPhysicsHistogramProducer;
+class AliHLTCaloHistoCellEnergy;
+class AliHLTCaloHistoClusterEnergy;
+class AliHLTCaloHistoInvMass;
+class AliHLTCaloHistoMatchedTracks;
+class TRefArray;
+
+/**
+ * @class AliHLTPHOSHistogramProducerComponent
+ *
+ * 
+ * @ingroup alihlt_phos
+ */
+
+class AliHLTCaloHistoComponent : public AliHLTProcessor
+{
+
+ public:
+
+  /** Constructor */
+  AliHLTCaloHistoComponent();
+  /** Destructor */
+  virtual ~AliHLTCaloHistoComponent();
+
+  /** interface function, see @ref AliHLTComponent for description */
+  const char* GetComponentID();
+
+  /** interface function, see @ref AliHLTComponent for description */
+  void GetInputDataTypes(AliHLTComponentDataTypeList& list);
+
+  /** interface function, see @ref AliHLTComponent for description */
+  AliHLTComponentDataType GetOutputDataType();
+
+  /** interface function, see @ref AliHLTComponent for description */
+  void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+  /** interface function, see @ref AliHLTComponent for description */
+  AliHLTComponent* Spawn();
+
+
+protected:
+
+  /** interface function, see @ref AliHLTComponent for description */
+  int DoEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
+  /** interface function, see @ref AliHLTComponent for description */
+  int DoInit(int argc, const char** argv);
+  /** interface function, see @ref AliHLTComponent for description */
+  int DoDeinit();
+
+  using AliHLTProcessor::DoEvent;
+
+ private:
+
+  /** Copy constructor prohibited*/  
+  AliHLTCaloHistoComponent(const AliHLTCaloHistoComponent & );
+  /** asssignment operator prohibited */
+  AliHLTCaloHistoComponent& operator=(const AliHLTCaloHistoComponent&);
+
+  TRefArray * fEmcalClustersArray;  //Array to contain EMCAL Clusters
+  TRefArray * fPhosClustersArray;  //Array to contain PHOS Clusters
+
+  Bool_t fDoPhos;       // Process PHOS data?
+  Bool_t fDoEmcal;      // Process EMCAL data?
+  Bool_t fDoCellEnergy; // make the cell energy histograms?
+  Bool_t fDoClusterEnergy; // make the cluster energy histograms?
+  Bool_t fDoInvariantMass; // make the invariant mass histograms?
+  Bool_t fDoMatchedTracks; // make the matched tracks histograms?
+  
+  AliHLTCaloHistoCellEnergy *fPhosCellEnergyHistProducer; // cell energy histogram producer
+  AliHLTCaloHistoCellEnergy *fEmcalCellEnergyHistProducer; // cell energy histogram producer
+
+  AliHLTCaloHistoClusterEnergy *fPhosClusterEnergyHistProducer; // PHOS cluster energy histogram producer
+  AliHLTCaloHistoClusterEnergy *fEmcalClusterEnergyHistProducer; // EMCAL cluster energy histogram producer
+
+  AliHLTCaloHistoInvMass *fPhosInvariantMassHistProducer; // PHOS invariant mass histogram producer
+  AliHLTCaloHistoInvMass *fEmcalInvariantMassHistProducer; // EMCAL insvariant mass histogram producer
+
+  AliHLTCaloHistoMatchedTracks *fPhosMatchedTracksHistProducer; // PHOS matched tracks histogram producer
+  AliHLTCaloHistoMatchedTracks *fEmcalMatchedTracksHistProducer; // EMCAL matched tracks histogram producer
+
+  ClassDef(AliHLTCaloHistoComponent, 1);
+
+};
+
+#endif
diff --git a/HLT/global/physics/AliHLTCaloHistoInvMass.cxx b/HLT/global/physics/AliHLTCaloHistoInvMass.cxx
new file mode 100644 (file)
index 0000000..5dee6b2
--- /dev/null
@@ -0,0 +1,141 @@
+//-*- Mode: C++ -*-
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * All rights reserved.                                                   *
+ *                                                                        *
+ * Primary Authors: Albin Gaignette, Svein Lindal                         *
+ *                                                                        *
+ * 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   AliHLTCaloHistoInvMass
+ * @author Albin Gaignette rewritten Svein Lindal <slindal@fys.uio.no>
+ * @date 
+ * @brief  
+ */
+
+// 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 "AliHLTCaloHistoInvMass.h"
+#include "AliESDCaloCluster.h"
+#include "TMath.h"
+
+// #include "AliHLTCaloClusterDataStruct.h"
+// #include "AliHLTCaloClusterReader.h"
+#include "TObjArray.h"
+#include "AliESDEvent.h"
+#include "AliESDCaloCluster.h"
+#include "TRefArray.h"
+#include "TH1F.h"
+#include "TString.h"
+
+AliHLTCaloHistoInvMass::AliHLTCaloHistoInvMass(TString det) :
+  fHistTwoClusterInvMass(NULL),
+  fHistArrayPtr(NULL)
+{
+  // See header file for documentation
+
+  fHistArrayPtr = new TObjArray;
+  
+  fHistTwoClusterInvMass = new TH1F(Form("%s fHistTwoClusterInvMass", det.Data()), Form("%s Invariant mass of two clusters PHOS", det.Data()), 200, 0, 1);
+  fHistTwoClusterInvMass->GetXaxis()->SetTitle("m_{#gamma#gamma} GeV");
+  fHistTwoClusterInvMass->GetYaxis()->SetTitle("Number of counts");
+  fHistTwoClusterInvMass->SetMarkerStyle(21);
+  fHistArrayPtr->AddLast(fHistTwoClusterInvMass);
+
+}
+
+AliHLTCaloHistoInvMass::~AliHLTCaloHistoInvMass()
+{
+  if(fHistTwoClusterInvMass)
+    delete fHistTwoClusterInvMass;
+  fHistTwoClusterInvMass = NULL;
+  if(fHistArrayPtr)
+    delete fHistArrayPtr;
+  fHistArrayPtr = NULL;
+
+}
+
+TObjArray* AliHLTCaloHistoInvMass::GetHistograms()
+{  
+  // See header file for documentation
+  return fHistArrayPtr;
+}
+
+Int_t AliHLTCaloHistoInvMass::FillHistograms(Int_t nc, TRefArray * clustersArray) {
+  //See header file for documentation
+  
+  Float_t cPos[nc][3];
+  Float_t cEnergy[nc];
+
+  for(int ic = 0; ic < nc; ic++) {
+    AliESDCaloCluster * cluster = static_cast<AliESDCaloCluster*>(clustersArray->At(ic));
+    cluster->GetPosition(cPos[ic]);
+    cEnergy[ic] = cluster->E();
+  }
+
+  for(Int_t ipho = 0; ipho<(nc-1); ipho++) { 
+    for(Int_t jpho = ipho+1; jpho<nc; jpho++) { 
+      // Calculate the theta angle between two photons
+      Double_t theta = (2* asin(0.5*TMath::Sqrt((cPos[ipho][0]-cPos[jpho][0])*(cPos[ipho][0]-cPos[jpho][0]) +(cPos[ipho][1]-cPos[jpho][1])*(cPos[ipho][1]-cPos[jpho][1]))/460));
+      
+      // Calculate the mass m of the pion candidate
+      Double_t m =(TMath::Sqrt(2 * cEnergy[ipho]* cEnergy[jpho]*(1-TMath::Cos(theta))));
+      
+      fHistTwoClusterInvMass->Fill(m);
+    }
+  }
+
+  return 0;
+}
+
+// Int_t AliHLTCaloHistoInvMass::DoEvent(AliHLTCaloClusterHeaderStruct* cHeader) {   
+  
+//   fClusterReader->SetMemory(cHeader);
+  
+//   int ncls = cHeader->fNClusters;
+//   Float_t* cPos[ncls];
+//   Float_t cEnergy[ncls];
+  
+//   AliHLTCaloClusterDataStruct* cluster;
+//   Int_t icls = 0;
+//   while ( ( cluster = fClusterReader->NextCluster() ) ) {
+    
+//     cPos[icls] = cluster->fGlobalPos;
+//     cEnergy[icls] = cluster->fEnergy; 
+    
+//     icls++;
+//   }  
+  
+//   for(Int_t ipho = 0; ipho<(ncls-1); ipho++) { 
+//     for(Int_t jpho = ipho+1 ; jpho<ncls ; jpho++) { 
+//       // Calcul of the theta angle between two photons
+//       Double_t theta = (2* asin(0.5*TMath::Sqrt((cPos[ipho][0]-cPos[jpho][0])*(cPos[ipho][0]-cPos[jpho][0]) +(cPos[ipho][1]-cPos[jpho][1])*(cPos[ipho][1]-cPos[jpho][1]))/460));
+      
+//       // Calcul of the mass m of the pion 
+//       Double_t m =(TMath::Sqrt(2 * cEnergy[ipho]* cEnergy[jpho]*(1-TMath::Cos(theta))));
+      
+
+//       //BALLE
+//       // fHistTwoClusterInvMass->Fill(m);
+//     }
+//   }
+  
+//   return 0;
+// }
+  
+
similarity index 73%
rename from HLT/PHOS/AliHLTPHOSHistoProdInvMass.h
rename to HLT/global/physics/AliHLTCaloHistoInvMass.h
index a476f95..c9328d1 100644 (file)
@@ -1,3 +1,4 @@
+//-*- Mode: C++ -*-
 /**************************************************************************
  * This file is property of and copyright by the ALICE HLT Project        * 
  * All rights reserved.                                                   *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-#ifndef ALIHLTPHOSHISTOPRODINVMASS_H
-#define ALIHLTPHOSHISTOPRODINVMASS_H
+#ifndef ALIHLTCALOHISTOINVMASS_H
+#define ALIHLTCALOHISTOINVMASS_H
 
 /** 
- * @file   AliHLTPHOSHistoProdInvMass
+ * @file   AliHLTCaloHistoInvMass
  * @author Albin Gaignette and Svein Lindal slindal@fys.uio.no
  * @date 
  * @brief  Produces Invariant mass histograms of PHOS clusters
 //#include "AliHLTPHOSBase.h"
 
 #include "Rtypes.h"
-#include "AliHLTPHOSConstant.h" 
+//#include "PHOS/AliHLTPHOSConstants.h" 
 
 class TObjArray;
 class TH1F;
 class AliHLTCaloClusterReader;
+class AliESDEvent;
+class TRefArray;
 struct AliHLTCaloClusterHeaderStruct;
-
-
-using namespace  PhosHLTConst;
-
+class TString;
+class TRefArray;
 
 /** 
- * @class AliHLTPHOSHistoProdInvMass
+ * @class AliHLTCaloHistoInvMass
  *
  * Class produces physics histograms for PHOS. It takes a TClonesArray
  * of AliESDCalocluster as input and fills several histograms
@@ -55,53 +56,43 @@ using namespace  PhosHLTConst;
  * @ingroup alihlt_phos
  */
 
-class AliHLTPHOSHistoProdInvMass 
-{
+class AliHLTCaloHistoInvMass {
 
 public:
   
   /** Constructor */
-  AliHLTPHOSHistoProdInvMass();
+  AliHLTCaloHistoInvMass(TString det);
 
   /** Destructor */
-  virtual ~AliHLTPHOSHistoProdInvMass();
-
-  /** Copy constructor */
-  AliHLTPHOSHistoProdInvMass(const AliHLTPHOSHistoProdInvMass &) :
-    fClusterReader(NULL),
-    fHistTwoClusterInvMass(NULL),
-    fHistArrayPtr(NULL)
-  {
-    // Copy constructor not implemented
-  }
-
-  /** Assignment operator */
-  AliHLTPHOSHistoProdInvMass & operator= (const AliHLTPHOSHistoProdInvMass)
-  {
-    // assignment
-    return *this;
-  }
-
-  /** Analyse the clusters in the event */
-  int DoEvent(AliHLTCaloClusterHeaderStruct* cHeader);
+  virtual ~AliHLTCaloHistoInvMass();
 
   /** Get a pointer to the TObjArray of histograms */
   TObjArray *GetHistograms();
 
+  //** Loops of the calo clusters and fills histos
+  Int_t FillHistograms(Int_t nc, TRefArray * clustersArray);
   
-  
- private:
+private:
 
+  /** Default constructor prohibited */
+  AliHLTCaloHistoInvMass();
+  
+  /** Copy constructor */
+  AliHLTCaloHistoInvMass(const AliHLTCaloHistoInvMass &);
+  
+  /** Assignment operator */
+  AliHLTCaloHistoInvMass & operator= (const AliHLTCaloHistoInvMass);
+  
   /** Cluster reader class   */
   AliHLTCaloClusterReader * fClusterReader;
-
+  
   /** Histogram of the 2 cluster invariant mass */
   TH1F *fHistTwoClusterInvMass;                 //!transient
-
+  
   /** Pointer to the array of histograms */
   TObjArray *fHistArrayPtr;                     //!transient
-
-  ClassDef(AliHLTPHOSHistoProdInvMass, 0);
+  
+  ClassDef(AliHLTCaloHistoInvMass, 0);
 
 };
  
diff --git a/HLT/global/physics/AliHLTCaloHistoMatchedTracks.cxx b/HLT/global/physics/AliHLTCaloHistoMatchedTracks.cxx
new file mode 100644 (file)
index 0000000..2bb91d0
--- /dev/null
@@ -0,0 +1,140 @@
+//-*- Mode: C++ -*-
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * All rights reserved.                                                   *
+ *                                                                        *
+ * Primary Authors: Albin Gaignette                                       *
+ *                                                                        *
+ * 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   AliHLTPHOSMatchedclustershistoProducer
+ * @author Albin Gaignette
+ * @date 
+ * @brief  Base Class for the Calo Matched track histograms
+ */
+
+// 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 "AliHLTCaloHistoMatchedTracks.h"
+#include "AliESDCaloCluster.h"
+#include "AliHLTCaloClusterDataStruct.h"
+#include "AliHLTCaloClusterReader.h"
+#include "TObjArray.h"
+#include "TH1F.h"
+#include "TObjArray.h"
+#include "TRefArray.h"
+#include "TString.h"
+
+AliHLTCaloHistoMatchedTracks::AliHLTCaloHistoMatchedTracks(TString det) :
+  //  fClusterReader(NULL),
+  fHistArrayPtr(NULL),
+  fHistMatchDistance(NULL),
+  fHistMatchedEnergy(NULL),
+  fHistUnMatchedEnergy(NULL)
+{
+  // See header file for documentation
+  fHistArrayPtr = new TObjArray;
+
+  //  fClusterReader = new AliHLTCaloClusterReader();
+  fHistMatchDistance = new TH1F( Form("%s fHistMatchDistance", det.Data()), Form("%s Track - Cluster residuals (cm)", det.Data()), 50, 0, 50);
+  fHistMatchDistance->GetXaxis()->SetTitle("Distance (cm)");
+  fHistMatchDistance->GetYaxis()->SetTitle("Count");
+  fHistMatchDistance->SetMarkerStyle(21);
+  fHistArrayPtr->AddLast(fHistMatchDistance);
+
+  fHistMatchedEnergy = new TH1F( Form("%s fHistMatchedEnergy", det.Data()), Form("%s Energy distribution of clusters with matching tracks", det.Data()), 200, 0, 200);
+  fHistMatchedEnergy->GetXaxis()->SetTitle("Cluster Energy (GeV)");
+  fHistMatchedEnergy->GetYaxis()->SetTitle("Number of clusters");
+  fHistMatchedEnergy->SetMarkerStyle(21);
+  fHistArrayPtr->AddLast(fHistMatchedEnergy);
+
+  fHistUnMatchedEnergy = new TH1F( Form("%s fHistUnMatchedEnergy", det.Data()), Form("%s Energy distribution of clusters with no matching track", det.Data()), 200, 0, 200);
+  fHistUnMatchedEnergy->GetXaxis()->SetTitle("Cluster Energy (GeV)");
+  fHistUnMatchedEnergy->GetYaxis()->SetTitle("Number of clusters");
+  fHistUnMatchedEnergy->SetMarkerStyle(21);
+  fHistArrayPtr->AddLast(fHistUnMatchedEnergy);
+
+}
+
+
+AliHLTCaloHistoMatchedTracks::~AliHLTCaloHistoMatchedTracks()
+{
+
+  if(fHistArrayPtr)
+    delete fHistArrayPtr;
+  fHistArrayPtr = NULL;
+
+  if(fHistMatchDistance){
+    delete fHistMatchDistance;
+    fHistMatchDistance = NULL;
+  }
+
+  if(fHistMatchedEnergy) {
+    delete fHistMatchedEnergy;
+    fHistMatchedEnergy = NULL;
+  }
+
+  if(fHistUnMatchedEnergy) {
+    delete fHistUnMatchedEnergy;
+    fHistUnMatchedEnergy = NULL;
+  }
+
+}
+
+
+TObjArray* AliHLTCaloHistoMatchedTracks::GetHistograms()
+{  
+  // See header file for documentation
+  return fHistArrayPtr;
+}
+
+
+// Int_t AliHLTCaloHistoMatchedTracks::DoEvent(AliHLTCaloClusterHeaderStruct* cHeader) {   
+  
+//   fClusterReader->SetMemory(cHeader);
+  
+//   AliHLTCaloClusterDataStruct* cluster;
+//   while ( ( cluster = fClusterReader->NextCluster() ) ) {
+    
+//     if(cluster->fTracksMatched->GetSize()>0) {
+//       fHistMatchedEnergy->Fill(cluster->fEnergy);
+//     } else {
+//       fHistUnMatchedEnergy->Fill(cluster->fEnergy);
+//     }
+//   }  
+  
+  
+//   return 0;
+// }
+  
+
+Int_t AliHLTCaloHistoMatchedTracks::FillHistograms(Int_t nClusters, TRefArray* clustersArray) {   
+  
+  for(int ic = 0; ic < nClusters; ic++) {
+    
+    AliESDCaloCluster * cluster = dynamic_cast<AliESDCaloCluster*>(clustersArray->At(ic));
+    
+    if(cluster->GetNTracksMatched() > 0) {
+      fHistMatchedEnergy->Fill(cluster->E());
+      fHistMatchDistance->Fill(cluster->GetEmcCpvDistance());
+    
+    } else {
+      fHistUnMatchedEnergy->Fill(cluster->E());
+    }
+  
+  }
+  
+  return 0;
+}
@@ -1,8 +1,9 @@
-/**************************************************************************
+//-*- Mode: C++ -*-
+ /**************************************************************************
  * This file is property of and copyright by the ALICE HLT Project        * 
  * All rights reserved.                                                   *
  *                                                                        *
- * Primary Authors: Albin Gaignette                                       *
+ * Primary Authors: Svein Lindal                                          *
  *                                                                        *
  * Permission to use, copy, modify and distribute this software and its   *
  * documentation strictly for non-commercial purposes is hereby granted   *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-#ifndef ALIHLTPHOSHISTOPRODMATCHEDTRACKS_H
-#define ALIHLTPHOSHISTOPRODMATCHEDTRACKS_H
+#ifndef ALIHLTCALOHISTOMATCHEDTRACKS_H
+#define ALIHLTCALOHISTOMATCHEDTRACKS_H
 
 /** 
- * @file   AliHLTPHOSHistoProdMatchedTracks
+ * @file   AliHLTCaloHistoMatchedTracks
  * @author Albin Gaignette and Svein Lindal slindal@fys.uio.no
  * @date 
  * @brief  Produces Invariant mass histograms of PHOS clusters
 #include "Rtypes.h"
 // #include "TClonesArray.h"
 
-#include "AliHLTPHOSConstant.h" 
-
-using namespace  PhosHLTConst;
 
+class TRefArray;
 class TObjArray;
 class TH1F;
-//class TH2F;
 class AliHLTCaloClusterReader;
+class AliESDEvent;
+class TString;
 struct AliHLTCaloClusterHeaderStruct;
 
 
 /** 
- * @class AliHLTPHOSHistoProdMatchedTracks
+ * @class AliHLTCaloHistoMatchedTracks
  *
  * Class produces physics histograms for PHOS. It takes a TClonesArray
  * of AliESDCalocluster as input and fills several histograms
@@ -68,62 +68,58 @@ struct AliHLTCaloClusterHeaderStruct;
 
 
 
-//class AliHLTPHOSHistoProdMatchedTracks : public AliHLTPHOSBase
-class AliHLTPHOSHistoProdMatchedTracks 
-{
+//class AliHLTCaloHistoMatchedTracks : public AliHLTPHOSBase
+class AliHLTCaloHistoMatchedTracks {
+
  public:
 
   /** Constructor */
-  AliHLTPHOSHistoProdMatchedTracks();
+  AliHLTCaloHistoMatchedTracks(TString det);
 
   /** Destructor */
-  virtual ~AliHLTPHOSHistoProdMatchedTracks();
-
-  /** Copy constructor */
-  AliHLTPHOSHistoProdMatchedTracks(const AliHLTPHOSHistoProdMatchedTracks &) :
-    fClusterReader(NULL),
-    fHistArrayPtr(0),
-    fHistMatchQuality(0),
-    fHistMatchedEnergy(0),
-    fHistUnMatchedEnergy(0)
-  {
-    // Copy constructor not implemented
-  }
+  virtual ~AliHLTCaloHistoMatchedTracks();
 
-  /** Assignment operator */
-  AliHLTPHOSHistoProdMatchedTracks & operator= (const AliHLTPHOSHistoProdMatchedTracks)
-  {
-    // assignment
-    return *this;
-  }
 
   /** Analyse the clusters in the event */
-  int DoEvent(AliHLTCaloClusterHeaderStruct* cHeader);
+ //   int DoEvent(AliHLTCaloClusterHeaderStruct* cHeader);
+//   int DoEvent(AliESDEvent * event);
 
+  /** Loop over cluster data and fill histograms */
+  int FillHistograms(Int_t nc, TRefArray * fClustersArray);
+  
   /** Get a pointer to the TObjArray of histograms */
-  TObjArray *GetHistograms();
+  TObjArray * GetHistograms();
 
   
   
  private:
+  
+  /** Default constructor prohibited */
+  AliHLTCaloHistoMatchedTracks();
+
+  /** Copy constructor prohibited*/
+  AliHLTCaloHistoMatchedTracks(const AliHLTCaloHistoMatchedTracks &);
+
+  /** Assignment operator */
+  AliHLTCaloHistoMatchedTracks & operator= (const AliHLTCaloHistoMatchedTracks);
 
   /** Cluster reader class   */
   AliHLTCaloClusterReader * fClusterReader;
 
   /** Pointer to the array of histograms */
-  TObjArray *fHistArrayPtr;                     //!transient
+  TObjArray *fHistArrayPtr;                 //!transient
 
   /** Histogram of the 2 cluster invariant mass */
-  TH1F *fHistMatchQuality;                 //!transient
+  TH1F *fHistMatchDistance;                  //!transient
   
-  /** Histograms of the energy distribution of mached and unmatched clusters*/
+  /** Histograms of the energy distribution of mached and unmatched clusters */
   TH1F *fHistMatchedEnergy;                 //!transient
-  TH1F *fHistUnMatchedEnergy;                 //!transient
+  TH1F *fHistUnMatchedEnergy;               //!transient
   
   
   
 
-  ClassDef(AliHLTPHOSHistoProdMatchedTracks, 0);
+  ClassDef(AliHLTCaloHistoMatchedTracks, 1);
 
 };
  
index 189a5da..7bf7f6e 100644 (file)
@@ -48,8 +48,7 @@ using namespace std;
 /** ROOT macro for the implementation of ROOT specific class methods */
 ClassImp(AliHLTV0HistoComponent)
 
-AliHLTV0HistoComponent::AliHLTV0HistoComponent()
-:
+AliHLTV0HistoComponent::AliHLTV0HistoComponent() :
   fUID(0),
   fGamma(0),
   fKShort(0),
@@ -113,8 +112,7 @@ AliHLTComponent* AliHLTV0HistoComponent::Spawn()
   return new AliHLTV0HistoComponent;
 }
 
-int AliHLTV0HistoComponent::DoInit( int argc, const char** argv )
-{
+int AliHLTV0HistoComponent::DoInit( int argc, const char** argv ) {
   // init
 
   fUID = 0;
index c6326f2..2a90396 100644 (file)
@@ -9,11 +9,12 @@ CLASS_HDRS:=  AliHLTGlobalEsdConverterComponent.h \
                AliHLTGlobalTrackMatcher.h \
                AliHLTGlobalVertexerHistoComponent.h \
                AliHLTGlobalHistoCollector.h \
-               physics/AliHLTV0HistoComponent.h 
-#              physics/AliHLTPHOSHistoProdInvMass.h \
-#              physics/AliHLTPHOSHistoProdMatchedTracks.h \
-#              physics/AliHLTPHOSHistoProdClusterEnergy.h \
-#              physics/AliHLTPHOSHistoProdCellEnergy.h
+               physics/AliHLTV0HistoComponent.h \
+               physics/AliHLTCaloHistoComponent.h \
+               physics/AliHLTCaloHistoInvMass.h \
+               physics/AliHLTCaloHistoMatchedTracks.h \
+               physics/AliHLTCaloHistoClusterEnergy.h \
+               physics/AliHLTCaloHistoCellEnergy.h 
 
 #              physics/AliHLTPHOSHistogramProducerComponent.h \
 #physics/AliHLTPHOSHistogramProducerComponent.h 
index 7632663..1546cca 100644 (file)
@@ -28,7 +28,6 @@ CLASS_HDRS:=  AliHLTPHOSClusterizerComponent.h \
                  AliHLTPHOSESDMaker.h \
                  AliHLTPHOSESDMakerComponent.h \
                  AliHLTPHOSUtilities.h \
-                 AliHLTPHOSHistogramProducer.h \
                  AliHLTPHOSMonitorTriggerComponent.h \
                  AliHLTPHOSESDEntriesMakerComponent.h \
                  AliHLTPHOSESDCaloClusterWriterComponent.h \