-//*********************************************************************
-// - AliEVE implementation -
+//
// Fill containers for visualisation of EMCAL data structures
-// - read and store MC Hits
-// - read and store digits from esds or runloader
+// - read and store MC Hits - read and store digits from esds or runloader
// - read and store clusters from esds or runloader
//
// Author: Magali Estienne (magali.estienne@cern.ch)
// June 30 2008
-//*********************************************************************
+//
+
+//#include <Riostream.h>
+//#include <vector>
-#include <TObject.h>
-#include <TEveUtil.h>
#include <TTree.h>
#include <TBranch.h>
#include <TObjArray.h>
#include <TRefArray.h>
#include <TClonesArray.h>
-#include <TEvePointSet.h>
+#include <TMath.h>
+#include <TLorentzVector.h>
-#include "AliRun.h"
#include "AliRunLoader.h"
+#include "AliEMCAL.h"
#include "AliEMCALLoader.h"
-#include "AliESDEvent.h"
#include "AliESDVertex.h"
-#include "AliEMCAL.h"
-#include "AliEMCALGeometry.h"
#include "AliEMCALHit.h"
#include "AliEMCALDigit.h"
#include "AliESDCaloCluster.h"
#include "AliEveEMCALData.h"
-#include "AliEveEMCALSModule.h"
#include "AliEveEMCALSModuleData.h"
+class Riostream;
+class TObject;
+class TEveUtil;
+class TEvePointSet;
+class AliRun;
+class AliESDEvent;
+class AliEMCAL;
+class AliEMCALGeometry;
+class AliEveEMCALSModule;
+
+using std::cout;
+using std::endl;
ClassImp(AliEveEMCALData)
//______________________________________________________________________________
delete fPoint;
}
-//______________________________________________________________________________
-void AliEveEMCALData::Reset()
-{
-
-}
-
//______________________________________________________________________________
AliEveEMCALData::AliEveEMCALData(const AliEveEMCALData &edata) :
TObject(edata),
}
//______________________________________________________________________________
-void AliEveEMCALData::SetTree(TTree* tree)
+void AliEveEMCALData::SetTree(TTree* const tree)
{
//
// Set digit-tree to be used for digit retrieval.
}
//______________________________________________________________________________
-void AliEveEMCALData::SetESD(AliESDEvent* esd)
+void AliEveEMCALData::SetESD(AliESDEvent* const esd)
{
//
// Set esd
}
//______________________________________________________________________________
-void AliEveEMCALData::SetNode(TGeoNode* node)
+void AliEveEMCALData::SetNode(TGeoNode* const node)
{
//
// Set node
}
//______________________________________________________________________________
-void AliEveEMCALData::InitEMCALGeom(AliRunLoader* rl)
+void AliEveEMCALData::InitEMCALGeom(AliRunLoader* const rl)
{
//
// Set data members for EMCAL geometry
}
//______________________________________________________________________________
-void AliEveEMCALData::LoadHits(TTree* t)
+void AliEveEMCALData::LoadHits(TTree* const t)
{
//
// Get hit information from RunLoader
}
//______________________________________________________________________________
-void AliEveEMCALData::LoadHitsFromEMCALLoader(AliEMCALLoader* emcl)
+void AliEveEMCALData::LoadHitsFromEMCALLoader(AliEMCALLoader* const emcl)
{
//
// Get hit information from EMCAL Loader
//
- AliEMCALHit* hit;
+ AliEMCALHit* hit;
- //Fill array of hits
- TClonesArray *hits = (TClonesArray*)emcl->Hits();
-
- //Get hits from the list
- for(Int_t ihit = 0; ihit< hits->GetEntries();ihit++){
-
- hit = static_cast<AliEMCALHit *>(hits->At(ihit)) ;
+ //Fill array of hits
+ TClonesArray *hits = 0;//(TClonesArray*)emcl->Hits();
+ TTree *treeH = emcl->TreeH();
+ if (treeH) {
+ Int_t nTrack = treeH->GetEntries(); // TreeH has array of hits for every primary
+ TBranch * branchH = treeH->GetBranch("EMCAL");
+ //if(fHits)fHits->Clear();
+ branchH->SetAddress(&hits);
+ for (Int_t iTrack = 0; iTrack < nTrack; iTrack++) {
+ branchH->GetEntry(iTrack);
+
+ //Get hits from the list
+ for(Int_t ihit = 0; ihit< hits->GetEntries();ihit++){
+
+ hit = static_cast<AliEMCALHit *>(hits->At(ihit)) ;
- if(hit != 0){
- if(fDebug>1) cout << "Hit info " << hit->GetId() << " " << hit->GetEnergy() << endl;
-
- Int_t id = hit->GetId();
- // These are local coordinates
- Double_t xl = 0.; Double_t yl = 0.; Double_t zl = 0.;
- // Get global coordinates
- Double_t x = hit->X();
- Double_t y = hit->Y();
- Double_t z = hit->Z();
- Double_t amp = hit->GetEnergy();
- Int_t iSupMod = 0;
- // Get SM Id
- GetGeomInfo(id,iSupMod,xl,yl,zl);
- fSM[iSupMod]->RegisterHit(id,iSupMod,amp,x,y,z);
- }
- }
-
+ if(hit != 0){
+ if(fDebug>1) cout << "Hit info " << hit->GetId() << " " << hit->GetEnergy() << endl;
+
+ Int_t id = hit->GetId();
+ // These are local coordinates
+ Double_t xl = 0.; Double_t yl = 0.; Double_t zl = 0.;
+ // Get global coordinates
+ Double_t x = hit->X();
+ Double_t y = hit->Y();
+ Double_t z = hit->Z();
+ Double_t amp = hit->GetEnergy();
+ Int_t iSupMod = 0;
+ // Get SM Id
+ GetGeomInfo(id,iSupMod,xl,yl,zl);
+ fSM[iSupMod]->RegisterHit(id,iSupMod,amp,x,y,z);
+ }//hit exists
+ }//hit loop
+ hits->Clear();
+ }// track loop
+ }//treeH exists
}
//______________________________________________________________________________
AliEMCALDigit * dig;
// Double_t amp = -1 ;
- Double_t ampInt = -1 ;
+ Double_t ampFlo = -1 ;
Int_t id = -1 ;
Int_t iSupMod = 0 ;
Double_t x, y, z;
if(dig != 0) {
id = dig->GetId() ; //cell (digit) label
// adc
- ampInt = dig->GetAmp(); //amplitude in cell (digit)
+ ampFlo = dig->GetAmplitude(); //amplitude in cell (digit)
// GeV
- // amp = ampInt*0.0153; // To be modified with correct OCDB conversion
+ // amp = ampFlo*0.0153; // To be modified with correct OCDB conversion
GetGeomInfo(id,iSupMod,x,y,z);
// // fSM[iSupMod]->SaveDigit(dig);
// // if(iSupMod<fNsmfull) fSMfull[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
// // if(iSupMod>fNsmfull) fSMhalf[iSupMod-10]->RegisterDigit(id,iSupMod,amp,x,y,z);
- fSM[iSupMod]->RegisterDigit(id,iSupMod,ampInt,x,y,z);
+ fSM[iSupMod]->RegisterDigit(id,iSupMod,ampFlo,x,y,z);
// fSM[iSupMod]->SaveDigit(dig);
// if(iSupMod<fNsmfull) fSMfull[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
// if(iSupMod>fNsmfull) fSMhalf[iSupMod-10]->RegisterDigit(id,iSupMod,amp,x,y,z);
}
//______________________________________________________________________________
-void AliEveEMCALData::LoadDigitsFromEMCALLoader(AliEMCALLoader* emcl)
+void AliEveEMCALData::LoadDigitsFromEMCALLoader(AliEMCALLoader* const emcl)
{
//
//Get digits from the list
// Double_t amp = -1 ;
- Double_t ampInt = -1 ;
+ Double_t ampFlo = -1 ;
Int_t id = -1 ;
Int_t iSupMod = 0 ;
Double_t x, y, z;
dig = static_cast<AliEMCALDigit *>(digits->At(idig)) ;
if(dig != 0){
- if(fDebug>1) cout << "Digit info " << dig->GetId() << " " << dig->GetAmp() << endl;
+ if(fDebug>1) cout << "Digit info " << dig->GetId() << " " << dig->GetAmplitude() << endl;
id = dig->GetId() ; //cell (digit) label
// adc
- ampInt = dig->GetAmp(); //amplitude in cell (digit)
+ ampFlo = dig->GetAmplitude(); //amplitude in cell (digit)
// GeV
- // amp = ampInt*0.0153.; // To be modified with correct OCDB conversion
+ // amp = ampFlo*0.0153.; // To be modified with correct OCDB conversion
GetGeomInfo(id,iSupMod,x,y,z);
// // GeV
// fSM[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
// adc
- fSM[iSupMod]->RegisterDigit(id,iSupMod,ampInt,x,y,z);
+ fSM[iSupMod]->RegisterDigit(id,iSupMod,ampFlo,x,y,z);
}
else {
cout << "Digit object empty" << endl;
{
Int_t id = cells.GetCellNumber(icell);
// adc
- Double_t ampInt = cells.GetAmplitude(icell);
+ Double_t ampFlo = cells.GetAmplitude(icell);
// GeV
- // Double_t amp = ampInt*0.0153; // To be modified with correct OCDB conversion
+ // Double_t amp = ampFlo*0.0153; // To be modified with correct OCDB conversion
GetGeomInfo(id,iSupMod,x,y,z);
// if(iSupMod<fNsmfull) fSMfull[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
// if(iSupMod>fNsmfull) fSMhalf[iSupMod-10]->RegisterDigit(id,iSupMod,amp,x,y,z);
// adc
- fSM[iSupMod]->RegisterDigit(id,iSupMod,ampInt,x,y,z);
- if(iSupMod<fNsmfull) fSMfull[iSupMod]->RegisterDigit(id,iSupMod,ampInt,x,y,z);
- if(iSupMod>fNsmfull) fSMhalf[iSupMod-10]->RegisterDigit(id,iSupMod,ampInt,x,y,z);
+ fSM[iSupMod]->RegisterDigit(id,iSupMod,ampFlo,x,y,z);
+ if(iSupMod<fNsmfull) fSMfull[iSupMod]->RegisterDigit(id,iSupMod,ampFlo,x,y,z);
+ if(iSupMod>fNsmfull) fSMhalf[iSupMod-10]->RegisterDigit(id,iSupMod,ampFlo,x,y,z);
} // end loop cells
}
//______________________________________________________________________________
-void AliEveEMCALData::LoadRecPoints(TTree* t)
+void AliEveEMCALData::LoadRecPoints(TTree* const t)
{
//
// Get rec point information from RunLoader
// GeV
Double_t amp = (Double_t)rp->GetEnergy();
// adc
- Double_t ampInt = amp/0.0153; // To be modified with correct OCDB conversion
+ Double_t ampFlo = amp/0.0153; // To be modified with correct OCDB conversion
TVector3 lpos;
rp->GetLocalPosition(lpos);
// // GeV
// fSM[iSupMod]->RegisterCluster(iSupMod,amp,lpos[0],lpos[1],lpos[2]);
// adc
- fSM[iSupMod]->RegisterCluster(iSupMod,ampInt,lpos[0],lpos[1],lpos[2]);
+ fSM[iSupMod]->RegisterCluster(iSupMod,ampFlo,lpos[0],lpos[1],lpos[2]);
}
}
}
}
//______________________________________________________________________________
-void AliEveEMCALData::LoadRecPointsFromEMCALLoader(AliEMCALLoader* emcl)
+void AliEveEMCALData::LoadRecPointsFromEMCALLoader(AliEMCALLoader* const emcl)
{
//
// Get rec point information from EMCAL Loader
if(fDebug>1) cout << "RecPoint info " << rp->GetAbsId() << " " << rp->GetEnergy() << endl;
Int_t iSupMod = rp->GetSuperModuleNumber();
Double_t amp = (Double_t)rp->GetEnergy();
- Double_t ampInt = amp/0.0153; // To be modified with correct OCDB conversion
+ Double_t ampFlo = amp/0.0153; // To be modified with correct OCDB conversion
TVector3 lpos;
rp->GetLocalPosition(lpos);
// // GeV
// fSM[iSupMod]->RegisterCluster(iSupMod,amp,lpos[0],lpos[1],lpos[2]);
// adc
- fSM[iSupMod]->RegisterCluster(iSupMod,ampInt,lpos[0],lpos[1],lpos[2]);
+ fSM[iSupMod]->RegisterCluster(iSupMod,ampFlo,lpos[0],lpos[1],lpos[2]);
}
}
// Get reconstructed vertex position
AliESDVertex* primVertex =(AliESDVertex*) fESD->GetVertex();
- Double_t vertex_position[3] ;
- primVertex->GetXYZ(vertex_position) ;
+ Double_t vertexPosition[3] ;
+ primVertex->GetXYZ(vertexPosition) ;
//Get the CaloClusters
//select EMCAL clusters only
Int_t nclus = caloClusters->GetEntries();
cout << "nclus: " << nclus << endl;
- if(!caloClusters) return;
-
for (Int_t iclus = 0; iclus < nclus; iclus++)
{
AliESDCaloCluster *clus = (AliESDCaloCluster *) caloClusters->At(iclus) ;
// adc
// Int_t eneInt = (Int_t)energy*500+0.5;
Double_t eneInt = energy/0.0153; // To be modified with correct OCDB conversion
- Double_t disp = clus->GetClusterDisp() ;
+ Double_t disp = clus->GetDispersion() ;
clus->GetPosition(pos) ; // Global position
TVector3 vpos(pos[0],pos[1],pos[2]) ;
TLorentzVector p4 ;
TVector3 p3;
- clus->GetMomentum(p4,vertex_position);
+ clus->GetMomentum(p4,vertexPosition);
p3.SetXYZ(p4[0],p4[1],p4[2]);
Double_t eta = p3.Eta();
Double_t phi = ( (p3.Phi()) < 0) ? (p3.Phi()) + 2. * TMath::Pi() : (p3.Phi());
}
//______________________________________________________________________________
-void AliEveEMCALData::LoadRaw()
+void AliEveEMCALData::LoadRaw() const
{
//
// Get raw information