X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=EVE%2FEveDet%2FAliEveEMCALData.cxx;h=ea40eafe7d1c7559ecf5df6c9580b9d741a14cec;hp=f0f6c45bd86355e3bde846b6a89a8afea581fcb8;hb=c82bb898b8c440b85fbbb1440ae0f21a9f2fb56d;hpb=a312477bc883568c8d16b013d910609551c555e9 diff --git a/EVE/EveDet/AliEveEMCALData.cxx b/EVE/EveDet/AliEveEMCALData.cxx index f0f6c45bd86..ea40eafe7d1 100644 --- a/EVE/EveDet/AliEveEMCALData.cxx +++ b/EVE/EveDet/AliEveEMCALData.cxx @@ -1,40 +1,49 @@ -//********************************************************************* -// - 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 +//#include -#include -#include #include #include #include #include #include -#include +#include +#include -#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 "AliEMCALRecPoint.h" #include "AliESDCaloCells.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) //______________________________________________________________________________ @@ -89,7 +98,7 @@ AliEveEMCALData::AliEveEMCALData(AliRunLoader* rl, TGeoNode* node, TGeoHMatrix* fSMfull(10), fSMhalf(2), fRunLoader(rl), - fDebug(2), + fDebug(0), fPoint(0) { @@ -116,19 +125,13 @@ AliEveEMCALData::~AliEveEMCALData() DeleteSuperModules(); delete fTree; - delete fEmcal; + // delete fEmcal; // deleted by run-loader delete fGeom; delete fNode; delete fHMatrix; delete fPoint; } -//______________________________________________________________________________ -void AliEveEMCALData::Reset() -{ - -} - //______________________________________________________________________________ AliEveEMCALData::AliEveEMCALData(const AliEveEMCALData &edata) : TObject(edata), @@ -172,7 +175,7 @@ AliEveEMCALData& AliEveEMCALData::operator=(const AliEveEMCALData &edata) } //______________________________________________________________________________ -void AliEveEMCALData::SetTree(TTree* tree) +void AliEveEMCALData::SetTree(TTree* const tree) { // // Set digit-tree to be used for digit retrieval. @@ -184,7 +187,7 @@ void AliEveEMCALData::SetTree(TTree* tree) } //______________________________________________________________________________ -void AliEveEMCALData::SetESD(AliESDEvent* esd) +void AliEveEMCALData::SetESD(AliESDEvent* const esd) { // // Set esd @@ -194,7 +197,7 @@ void AliEveEMCALData::SetESD(AliESDEvent* esd) } //______________________________________________________________________________ -void AliEveEMCALData::SetNode(TGeoNode* node) +void AliEveEMCALData::SetNode(TGeoNode* const node) { // // Set node @@ -204,7 +207,7 @@ void AliEveEMCALData::SetNode(TGeoNode* node) } //______________________________________________________________________________ -void AliEveEMCALData::InitEMCALGeom(AliRunLoader* rl) +void AliEveEMCALData::InitEMCALGeom(AliRunLoader* const rl) { // // Set data members for EMCAL geometry @@ -298,7 +301,7 @@ void AliEveEMCALData::DeleteSuperModules() } //______________________________________________________________________________ -void AliEveEMCALData::LoadHits(TTree* t) +void AliEveEMCALData::LoadHits(TTree* const t) { // // Get hit information from RunLoader @@ -349,40 +352,50 @@ void AliEveEMCALData::LoadHits(TTree* t) } //______________________________________________________________________________ -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(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(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 } //______________________________________________________________________________ @@ -401,7 +414,7 @@ void AliEveEMCALData::LoadDigits(TTree *t) 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; @@ -413,9 +426,9 @@ void AliEveEMCALData::LoadDigits(TTree *t) 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); @@ -424,7 +437,7 @@ void AliEveEMCALData::LoadDigits(TTree *t) // // fSM[iSupMod]->SaveDigit(dig); // // if(iSupModRegisterDigit(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(iSupModRegisterDigit(id,iSupMod,amp,x,y,z); // if(iSupMod>fNsmfull) fSMhalf[iSupMod-10]->RegisterDigit(id,iSupMod,amp,x,y,z); @@ -438,7 +451,7 @@ void AliEveEMCALData::LoadDigits(TTree *t) } //______________________________________________________________________________ -void AliEveEMCALData::LoadDigitsFromEMCALLoader(AliEMCALLoader* emcl) +void AliEveEMCALData::LoadDigitsFromEMCALLoader(AliEMCALLoader* const emcl) { // @@ -453,7 +466,7 @@ void AliEveEMCALData::LoadDigitsFromEMCALLoader(AliEMCALLoader* 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; @@ -463,19 +476,19 @@ void AliEveEMCALData::LoadDigitsFromEMCALLoader(AliEMCALLoader* emcl) dig = static_cast(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; @@ -502,9 +515,9 @@ void AliEveEMCALData::LoadDigitsFromESD() { 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); @@ -513,15 +526,15 @@ void AliEveEMCALData::LoadDigitsFromESD() // if(iSupModRegisterDigit(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(iSupModRegisterDigit(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(iSupModRegisterDigit(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 @@ -547,14 +560,14 @@ void AliEveEMCALData::LoadRecPoints(TTree* t) // 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]); } } } @@ -562,7 +575,7 @@ void AliEveEMCALData::LoadRecPoints(TTree* t) } //______________________________________________________________________________ -void AliEveEMCALData::LoadRecPointsFromEMCALLoader(AliEMCALLoader* emcl) +void AliEveEMCALData::LoadRecPointsFromEMCALLoader(AliEMCALLoader* const emcl) { // // Get rec point information from EMCAL Loader @@ -589,14 +602,14 @@ void AliEveEMCALData::LoadRecPointsFromEMCALLoader(AliEMCALLoader* emcl) 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]); } } @@ -620,8 +633,8 @@ void AliEveEMCALData::LoadRecPointsFromESD() // 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 @@ -630,8 +643,6 @@ void AliEveEMCALData::LoadRecPointsFromESD() 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) ; @@ -641,13 +652,13 @@ void AliEveEMCALData::LoadRecPointsFromESD() // 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()); @@ -706,7 +717,7 @@ AliEveEMCALSModuleData* AliEveEMCALData::GetSModuleData(Int_t sm) } //______________________________________________________________________________ -void AliEveEMCALData::LoadRaw() +void AliEveEMCALData::LoadRaw() const { // // Get raw information