fSMfull(10),
fSMhalf(2),
fRunLoader(rl),
- fDebug(0),
+ fDebug(2),
fPoint(0)
{
//______________________________________________________________________________
void AliEveEMCALData::SetTree(TTree* tree)
{
-
- // Set digit-tree to be used for digit retrieval. Data is loaded on
- // demand.
+ //
+ // Set digit-tree to be used for digit retrieval.
+ // Data is loaded on demand.
+ //
fTree = tree;
//______________________________________________________________________________
void AliEveEMCALData::SetESD(AliESDEvent* esd)
{
+ //
+ // Set esd
+ //
+
fESD = esd;
}
//______________________________________________________________________________
void AliEveEMCALData::SetNode(TGeoNode* node)
{
+ //
+ // Set node
+ //
+
fNode = node;
}
//______________________________________________________________________________
void AliEveEMCALData::InitEMCALGeom(AliRunLoader* rl)
{
-// // Handle an individual point selection from GL.
+ //
+ // Set data members for EMCAL geometry
+ //
-// fParent->SpawnEditor();
fEmcal = (AliEMCAL*) rl->GetAliRun()->GetDetector("EMCAL");
fGeom = (AliEMCALGeometry*) fEmcal->GetGeometry();
//______________________________________________________________________________
void AliEveEMCALData::GetGeomInfo(Int_t id, Int_t &iSupMod, Double_t& x, Double_t& y, Double_t& z)
{
+ //
// Get geometrical information from hit/digit/cluster absolute id
+ //
Int_t iTower = 0 ;
Int_t iIphi = 0 ;
Int_t iIeta = 0 ;
- Int_t iphi = 0 ;
- Int_t ieta = 0 ;
//Geometry methods
fGeom->GetCellIndex(id,iSupMod,iTower,iIphi,iIeta);
//______________________________________________________________________________
void AliEveEMCALData::CreateAllSModules()
{
-
+ //
// Create all fNsm super modules
+ //
+
for(Int_t sm = 0; sm < fNsm; sm++)
CreateSModule(sm);
//______________________________________________________________________________
void AliEveEMCALData::CreateSModule(Int_t sm)
{
- // Create super-module-data for sm if it does not exist already.
+ //
+ // Create super-module-data for SM if it does not exist already.
+ //
+
if(fSM[sm] == 0) fSM[sm] = new AliEveEMCALSModuleData(sm,fGeom,fNode,fHMatrix);
if(fSMfull[sm] == 0 && sm < 10) fSMfull[sm] = new AliEveEMCALSModuleData(sm,fGeom,fNode,fHMatrix);
if(fSMhalf[sm-10] == 0 && sm > 10) fSMhalf[sm-10] = new AliEveEMCALSModuleData(sm,fGeom,fNode,fHMatrix);
//______________________________________________________________________________
void AliEveEMCALData::DropAllSModules()
{
+ //
// Drop data of all existing sectors.
+ //
for (Int_t sm = 0; sm < fNsm; sm++) {
if (fSM[sm] != 0)
void AliEveEMCALData::DeleteSuperModules()
{
//
- // delete all super module data
+ // Delete all super module data
//
for (Int_t sm = 0; sm < fNsm; sm++)
//______________________________________________________________________________
void AliEveEMCALData::LoadHits(TTree* t)
{
+ //
+ // Get hit information from RunLoader
+ //
- // With TTreeH
-
+ /*
// These are global coordinates !
char form[1000];
const char *selection = "";
delete fPoint;
// return 0;
}
+ */
-
-// TObjArray *harr=NULL;
-// TBranch *hbranch=t->GetBranch("EMCAL");
-// hbranch->SetAddress(&harr);
+ TObjArray *harr=NULL;
+ TBranch *hbranch=t->GetBranch("EMCAL");
+ hbranch->SetAddress(&harr);
-// if(hbranch->GetEvent(0)) {
-// for(Int_t ih = 0; ih < harr->GetEntriesFast(); ih++) {
-// AliEMCALHit* hit =(AliEMCALHit*)harr->UncheckedAt(ih);
-// if(hit != 0){
-// cout << "Hit info " << hit->GetId() << " " << hit->GetEnergy() << endl;
-// fSM[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
-// }
-// }
-// }
-// //********************************
-// // To be completed !!!
-// //********************************
-
+ if(hbranch->GetEvent(0)) {
+ for(Int_t ih = 0; ih < harr->GetEntriesFast(); ih++) {
+ AliEMCALHit* hit =(AliEMCALHit*)harr->UncheckedAt(ih);
+ 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);
+ }
+ }
+ }
}
//______________________________________________________________________________
void AliEveEMCALData::LoadHitsFromEMCALLoader(AliEMCALLoader* emcl)
{
+ //
+ // Get hit information from EMCAL Loader
+ //
- // Need to know the local position in each sm
-
- // With EMCALLoader
AliEMCALHit* hit;
//Fill array of hits
//Get hits from the list
for(Int_t ihit = 0; ihit< hits->GetEntries();ihit++){
- //cout<<">> idig "<<idig<<endl;
+
hit = static_cast<AliEMCALHit *>(hits->At(ihit)) ;
if(hit != 0){
- cout << "Hit info " << hit->GetId() << " " << hit->GetEnergy() << endl;
+ 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);
}
}
- //********************************
- // To be completed !!!
- //********************************
-
-
-
}
//______________________________________________________________________________
void AliEveEMCALData::LoadDigits(TTree *t)
{
//
- // load digits from the TreeD
+ // Get digit information from RunLoader
//
TClonesArray *digits = 0;
cout << "nEnt: " << nEnt << endl;
AliEMCALDigit * dig;
- Float_t amp = -1 ;
+ // Double_t amp = -1 ;
+ Double_t ampInt = -1 ;
Int_t id = -1 ;
Int_t iSupMod = 0 ;
Double_t x, y, z;
if(dig != 0) {
id = dig->GetId() ; //cell (digit) label
- amp = dig->GetAmp(); //amplitude in cell (digit)
-
+ // adc
+ ampInt = dig->GetAmp(); //amplitude in cell (digit)
+ // GeV
+ // amp = ampInt*0.0153; // To be modified with correct OCDB conversion
+
GetGeomInfo(id,iSupMod,x,y,z);
- fSM[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
+// // GeV
+// fSM[iSupMod]->RegisterDigit(id,iSupMod,amp,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]->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);
{
//
- // load digits from EMCAL Loader
+ // Get digit information from EMCAL Loader
//
AliEMCALDigit* dig;
//Get digits from the list
- Float_t amp = -1 ;
+ // Double_t amp = -1 ;
+ Double_t ampInt = -1 ;
Int_t id = -1 ;
Int_t iSupMod = 0 ;
Double_t x, y, z;
if(dig != 0){
if(fDebug>1) cout << "Digit info " << dig->GetId() << " " << dig->GetAmp() << endl;
id = dig->GetId() ; //cell (digit) label
- amp = dig->GetAmp(); //amplitude in cell (digit)
-
+ // adc
+ ampInt = dig->GetAmp(); //amplitude in cell (digit)
+ // GeV
+ // amp = ampInt*0.0153.; // To be modified with correct OCDB conversion
+
GetGeomInfo(id,iSupMod,x,y,z);
- fSM[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
+ // // GeV
+ // fSM[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
+ // adc
+ fSM[iSupMod]->RegisterDigit(id,iSupMod,ampInt,x,y,z);
}
else {
cout << "Digit object empty" << endl;
AliESDCaloCells &cells= *(fESD->GetEMCALCells());
Int_t ncell = cells.GetNumberOfCells() ;
- Int_t type = cells.GetType();
- Float_t pos[3] ;
Int_t iSupMod = 0 ;
Double_t x, y, z;
for (Int_t icell= 0; icell < ncell; icell++)
{
Int_t id = cells.GetCellNumber(icell);
- Float_t amp = cells.GetAmplitude(icell);
+ // adc
+ Double_t ampInt = cells.GetAmplitude(icell);
+ // GeV
+ // Double_t amp = ampInt*0.0153; // To be modified with correct OCDB conversion
GetGeomInfo(id,iSupMod,x,y,z);
- fSM[iSupMod]->RegisterDigit(id,iSupMod,amp,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);
+// // GeV
+// fSM[iSupMod]->RegisterDigit(id,iSupMod,amp,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);
} // end loop cells
}
//______________________________________________________________________________
void AliEveEMCALData::LoadRecPoints(TTree* t)
{
+ //
+ // Get rec point information from RunLoader
+ //
+
//*************************************************
// To be improved !!!!!
// Size and shape of cluster to be implemented
for(Int_t ic = 0; ic < carr->GetEntriesFast(); ic++) {
AliEMCALRecPoint* rp =(AliEMCALRecPoint*)carr->UncheckedAt(ic);
if(rp){
- cout << "RecPoint info " << rp->GetAbsId() << " " << rp->GetEnergy() << endl;
+ if(fDebug>1) cout << "RecPoint info " << rp->GetAbsId() << " " << rp->GetEnergy() << endl;
Int_t iSupMod = rp->GetSuperModuleNumber();
- Float_t amp = rp->GetEnergy();
+ // GeV
+ Double_t amp = (Double_t)rp->GetEnergy();
+ // adc
+ Double_t ampInt = amp/0.0153; // To be modified with correct OCDB conversion
TVector3 lpos;
rp->GetLocalPosition(lpos);
- fSM[iSupMod]->RegisterCluster(iSupMod,amp,lpos[0],lpos[1],lpos[2]);
+// // GeV
+// fSM[iSupMod]->RegisterCluster(iSupMod,amp,lpos[0],lpos[1],lpos[2]);
+ // adc
+ fSM[iSupMod]->RegisterCluster(iSupMod,ampInt,lpos[0],lpos[1],lpos[2]);
}
}
}
//______________________________________________________________________________
void AliEveEMCALData::LoadRecPointsFromEMCALLoader(AliEMCALLoader* emcl)
{
+ //
+ // Get rec point information from EMCAL Loader
+ //
+
//*************************************************
// To be improved !!!!!
// Size and shape of cluster to be implemented
rp = static_cast<AliEMCALRecPoint *>(clusters->At(iclu)) ;
if(rp){
- cout << "RecPoint info " << rp->GetAbsId() << " " << rp->GetEnergy() << endl;
+ if(fDebug>1) cout << "RecPoint info " << rp->GetAbsId() << " " << rp->GetEnergy() << endl;
Int_t iSupMod = rp->GetSuperModuleNumber();
- Float_t amp = rp->GetEnergy();
+ Double_t amp = (Double_t)rp->GetEnergy();
+ Double_t ampInt = amp/0.0153; // To be modified with correct OCDB conversion
TVector3 lpos;
rp->GetLocalPosition(lpos);
- fSM[iSupMod]->RegisterCluster(iSupMod,amp,lpos[0],lpos[1],lpos[2]);
+// // GeV
+// fSM[iSupMod]->RegisterCluster(iSupMod,amp,lpos[0],lpos[1],lpos[2]);
+ // adc
+ fSM[iSupMod]->RegisterCluster(iSupMod,ampInt,lpos[0],lpos[1],lpos[2]);
}
}
//______________________________________________________________________________
void AliEveEMCALData::LoadRecPointsFromESD()
{
- Int_t iSupMod = 0 ;
+ //
+ // Get cluster information from esd
+ //
+
+ Int_t iSupMod = 0 ;
Double_t x, y, z;
Int_t iSM = 0 ;
Int_t iT = 0 ;
Int_t iIp = 0 ;
Int_t iIe = 0 ;
- Int_t ip = 0 ;
- Int_t ie = 0 ;
Double_t xd, yd, zd;
Float_t pos[3] ;
AliESDCaloCluster *clus = (AliESDCaloCluster *) caloClusters->At(iclus) ;
//Get the cluster info
- Float_t energy = clus->E() ;
- Int_t eneInt = (Int_t) energy*500+0.5;
- Float_t disp = clus->GetClusterDisp() ;
- Int_t iprim = clus->GetLabel();
+ Double_t energy = clus->E() ;
+ // 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() ;
clus->GetPosition(pos) ; // Global position
TVector3 vpos(pos[0],pos[1],pos[2]) ;
TVector3 p3;
clus->GetMomentum(p4,vertex_position);
p3.SetXYZ(p4[0],p4[1],p4[2]);
- Float_t eta = p3.Eta();
- Float_t phi = ( (p3.Phi()) < 0) ? (p3.Phi()) + 2. * TMath::Pi() : (p3.Phi());
+ Double_t eta = p3.Eta();
+ Double_t phi = ( (p3.Phi()) < 0) ? (p3.Phi()) + 2. * TMath::Pi() : (p3.Phi());
Int_t mult = clus->GetNCells() ;
- if(fDebug>1) {
- cout << "In cluster: " << iclus << ", ncells: " << mult << ", energy: " <<
- eneInt << ", disp: " << disp << endl;
+ if(fDebug>2) {
+ cout << "In cluster: " << iclus << ", ncells: " << mult << ", energy : " << energy <<
+ ", disp: " << disp << endl;
cout << "Cluster " << iclus << ", eta: " << eta << ", phi: " << phi << endl;
}
Int_t clusId = 0;
fGeom->GetAbsCellIdFromEtaPhi(eta,phi,clusId);
- if(fDebug>1) {
+ if(fDebug>2) {
cout << "Abs Cluster Id: " << clusId << ", xc: " << pos[0] <<
", yc: " << pos[1] << ", zc: " << pos[2] << endl;
}
GetGeomInfo(clusId,iSupMod,x,y,z);
//******** Not used yet but will come ********
+ // AliESDCaloCells &cells= *(fESD->GetEMCALCells());
Int_t digMult = clus->GetNCells() ;
UShort_t *digID = clus->GetCellsAbsId() ;
for(Int_t i=0; i<digMult; i++){
+ // Float_t digitAmp = cells.GetCellAmplitude(digID[i]) ;
fGeom->RelPosCellInSModule(digID[i], xd, yd, zd);
//Geometry methods
fGeom->GetCellIndex(digID[i],iSM,iT,iIp,iIe);
} // end digit loop
//*********************************************
-
- fSM[iSupMod]->RegisterCluster(iSM,energy,x,y,z);
+ // // GeV
+ // fSM[iSupMod]->RegisterCluster(iSM,energy,x,y,z);
+ // adc
+ fSM[iSupMod]->RegisterCluster(iSM,eneInt,x,y,z);
} // end cluster loop
}
AliEveEMCALSModuleData* AliEveEMCALData::GetSModuleData(Int_t sm)
{
//
- // return super module data
+ // Return super module data
//
if (sm < 0 || sm > fNsm)
//______________________________________________________________________________
void AliEveEMCALData::LoadRaw()
{
+ //
+ // Get raw information
+ //
+ // To be implemented !
}
protected:
AliEMCAL* fEmcal; // EMCal data member
AliEMCALGeometry* fGeom; // Data member to set/call EMCAL geometry
- TGeoNode* fNode; // node
+ TGeoNode* fNode; // Node for bbox definition
TGeoHMatrix* fHMatrix; // matrix for local to global transformation
- TTree* fTree; // tree
- AliESDEvent* fESD; // esd
+ TTree* fTree; // Tree
+ AliESDEvent* fESD; // Esd
Int_t fNsm; // Total number of Super Modules
Int_t fNsmfull; // Number of full size Super Modules
Int_t fNsmhalf; // Number of half size Super Modules
std::vector<AliEveEMCALSModuleData*> fSMhalf; // vector of fNhalf SModules
AliRunLoader* fRunLoader; // Run Loader
Int_t fDebug; // Debug option
- TEvePointSet* fPoint; // TEvePointSet for hits
+ TEvePointSet* fPoint; // TEvePointSet for hits
private:
AliEveEMCALData(const AliEveEMCALData &edata);
ClassImp(AliEveEMCALSModule)
+Bool_t AliEveEMCALSModule::fStaticInit = kFALSE;
+
TEveFrameBox* AliEveEMCALSModule::fFrameBigBox = 0;
TEveFrameBox* AliEveEMCALSModule::fFrameSmallBox = 0;
TEveRGBAPalette* AliEveEMCALSModule::fFrameDigPalette = 0;
AliEveEMCALSModule::AliEveEMCALSModule(Int_t smid, const Text_t* n, const Text_t* t) :
TEveElement(fFrameColor),
TNamed(n,t),
+ TAtt3D(),
+ TAttBBox(),
fEMCALData(0),
fEMCALSModuleData(0),
fFrameColor((Color_t)10),
AliEveEMCALSModule::AliEveEMCALSModule(const AliEveEMCALSModule &esm) :
TEveElement(fFrameColor),
TNamed(),
+ TAtt3D(),
+ TAttBBox(),
fEMCALData(esm.fEMCALData),
fEMCALSModuleData(esm.fEMCALSModuleData),
fFrameColor(esm.fFrameColor),
fColorArray(esm.fColorArray),
fDebug(esm.fDebug)
{
- // Constructor.
+ // Copy constructor.
Char_t name[256];
if (fSModuleID < 10) {
sprintf(name,"Full Super Module %02d",fSModuleID);
void AliEveEMCALSModule::ComputeBBox()
{
//
- // bounding box
+ // Bounding box, Framebox and Palette
//
fEMCALSModuleData->GetSModuleBigBox(fSMBigBBox[0],fSMBigBBox[1], fSMBigBBox[2]);
fEMCALSModuleData->GetSModuleSmallBox(fSMSmallBBox[0],fSMSmallBBox[1], fSMSmallBBox[2]);
-// if (fgStaticInitDone) return;
-// fgStaticInitDone = kTRUE;
+ if (fStaticInit) return;
+ fStaticInit = kTRUE;
fFrameBigBox = new TEveFrameBox();
fFrameBigBox->SetAABoxCenterHalfSize(0, 0, 0, fSMBigBBox[0], fSMBigBBox[1], fSMBigBBox[2]);
void AliEveEMCALSModule::SetThreshold(Short_t t)
{
//
- // digits amplitude threshold
+ // Digit amplitude threshold
//
fThreshold = TMath::Min(t, (Short_t)(fMaxVal - 1));
void AliEveEMCALSModule::SetMaxVal(Int_t mv)
{
//
- // digits amplitude maximum value
+ // Digit amplitude maximum value
//
fMaxVal = TMath::Max(mv, (Int_t)(fThreshold + 1));
void AliEveEMCALSModule::SetClusterSize(Int_t size)
{
//
- // cluster point size
+ // Cluster point size
//
fClusterSize = TMath::Max(1, size);
Int_t AliEveEMCALSModule::ColorIndex(Int_t val) const
{
//
- // index color
+ // Index color
//
if(val < fThreshold) val = fThreshold;
void AliEveEMCALSModule::SetupColorArray() const
{
//
- // build array of colors
+ // Build array of colors
//
if(fColorArray)
void AliEveEMCALSModule::ClearColorArray()
{
//
- // delete array of colors
+ // Delete array of colors
//
if(fColorArray) {
//______________________________________________________________________________
void AliEveEMCALSModule::SetDataSource(AliEveEMCALData* data)
{
+ //
// Set source of data.
+ //
if (data == fEMCALData) return;
if(fEMCALData) fEMCALData->DecRefCount();
fEMCALData = data;
if(fEMCALData) fEMCALData->IncRefCount();
+ // Get pointer on SM data
fEMCALSModuleData = GetSModuleData();
IncRTS();
//______________________________________________________________________________
AliEveEMCALSModuleData* AliEveEMCALSModule::GetSModuleData() const
{
+ //
// Return source of data.
+ //
return fEMCALData ? fEMCALData->GetSModuleData(fSModuleID) : 0;
}
//______________________________________________________________________________
void AliEveEMCALSModule::UpdateQuads()
{
+ //
// Update hit/digit/cluster representation.
+ //
- vector< vector<Float_t> > bufferDigit;
- vector< vector<Float_t> > bufferCluster;
+ vector< vector<Double_t> > bufferDigit;
+ vector< vector<Double_t> > bufferCluster;
vector< vector<Float_t> > bufferHit;
- Float_t x0, y0, z, w, h, clsq;
- Int_t charge, cathode, nDigits, nClusters, nHits, oldSize, ic1, ic2;
- Double_t clsX, clsY, clsZ;
+ Int_t nDigits, nClusters, nHits, oldSize;
Float_t hitX, hitY, hitZ;
Int_t smId = fEMCALSModuleData->GetSmId();
//--------------------------
fPointSet->Reset();
+ /*
TEvePointSet* points = fEMCALData->GetPointSetData();
char form[1000];
if(points){
}
else {printf("There is no hits in Runloader \n"); }
+ */
+
if (fEMCALSModuleData != 0) {
// digits ------------------------
+
+ // Define TEveQuadSet for digits
fQuadSet->SetOwnIds(kTRUE);
fQuadSet->Reset(TEveQuadSet::kQT_RectangleYZFixedDimX, kFALSE, 32);
fQuadSet->SetDefWidth (fEMCALSModuleData->GetPhiTileSize());
fQuadSet->SetFrame(fFrameBigBox);
else fQuadSet->SetFrame(fFrameSmallBox);
+ // Get the digit information from the buffer
bufferDigit = fEMCALSModuleData->GetDigitBuffer();
if(!bufferDigit.empty())
{
if(fDebug>1) cout << "nDigits: " << nDigits << endl;
// loop over digits
for (Int_t id = 0; id < nDigits; id++) {
- if(fDebug>1) {
- cout << "bufferDigit[" << id << "][0]: " << bufferDigit[id][0] << endl;
- cout << "bufferDigit[" << id << "][1]: " << bufferDigit[id][1] << endl;
- cout << "bufferDigit[" << id << "][2]: " << bufferDigit[id][2] << endl;
- cout << "bufferDigit[" << id << "][3]: " << bufferDigit[id][3] << endl;
- cout << "bufferDigit[" << id << "][4]: " << bufferDigit[id][4] << endl;
- }
- Int_t iid = bufferDigit[id][0];
- Int_t isupMod = bufferDigit[id][1];
- Float_t iamp = bufferDigit[id][2];
- Float_t ix = bufferDigit[id][3];
- Float_t iy = bufferDigit[id][4];
- Float_t iz = bufferDigit[id][5];
+ // Int_t iid = (Int_t)bufferDigit[id][0];
+ // Int_t isupMod = (Int_t)bufferDigit[id][1];
+ Double_t iamp = bufferDigit[id][2];
+ Int_t amp = (Int_t)(iamp+0.5);
+ // Double_t ix = bufferDigit[id][3];
+ Double_t iy = bufferDigit[id][4];
+ Double_t iz = bufferDigit[id][5];
+ // Add digit information to the TEveQuadSet
fQuadSet->AddQuad(iy, iz);
- fQuadSet->QuadValue(iamp);
- // fQuadSet->QuadId(iid);
-
+ fQuadSet->QuadValue(amp);
} // end digits loop
}
else { printf("There is no digits in SM %d \n", smId); }
// hits --------------------------
- bufferHit = fEMCALSModuleData->GetDigitBuffer();
+ bufferHit = fEMCALSModuleData->GetHitBuffer();
if(!bufferHit.empty())
{
+ char form[1000];
nHits = fEMCALSModuleData->GetNHits();
if(fDebug>1) cout << "nHits: " << nHits << endl;
oldSize = fPointSet->GrowFor(nHits);
// Loop over hits
for (Int_t ih = 0; ih < nHits; ih++) {
- hitX = bufferHit[ih][2];
- hitY = bufferHit[ih][3];
- hitZ = bufferHit[ih][4];
+ hitX = bufferHit[ih][3];
+ hitY = bufferHit[ih][4];
+ hitZ = bufferHit[ih][5];
fPointSet->SetPoint(ih,hitX,hitY,hitZ);
+ sprintf(form,"N=%d", fPointSet->Size());
+ fPointSet->SetTitle(form);
+ fPointSet->SetMarkerSize(.5);
+ fPointSet->SetMarkerColor((Color_t)2);
}
}
else {printf("There is no hits in SM %d \n", smId); }
// clusters ------------------------
+
+ // Define TEveQuadSet for clusters
fQuadSet2->SetOwnIds(kTRUE);
fQuadSet2->Reset(TEveQuadSet::kQT_RectangleYZFixedDimX, kFALSE, 32);
fQuadSet2->SetDefWidth (fEMCALSModuleData->GetPhiTileSize());
fQuadSet2->SetFrame(fFrameBigBox);
else fQuadSet2->SetFrame(fFrameSmallBox);
+ // Get the cluster information from the buffer
bufferCluster = fEMCALSModuleData->GetClusterBuffer();
if(!bufferCluster.empty())
{
cout << "bufferCluster[" << id << "][3]: " << bufferCluster[id][3] << endl;
cout << "bufferCluster[" << id << "][4]: " << bufferCluster[id][4] << endl;
}
- Int_t isupMod = bufferCluster[id][0];
- Float_t iamp = bufferCluster[id][1];
- Float_t ix = bufferCluster[id][2];
- Float_t iy = bufferCluster[id][3];
- Float_t iz = bufferCluster[id][4];
+ // Int_t isupMod = (Int_t)bufferCluster[id][0];
+ Double_t iamp = bufferCluster[id][1];
+ Int_t amp = (Int_t)(iamp+0.5);
+ // Double_t ix = bufferCluster[id][2];
+ Double_t iy = bufferCluster[id][3];
+ Double_t iz = bufferCluster[id][4];
+ // Add cluster information to the TEveQuadSet
fQuadSet2->AddQuad(iy, iz);
- fQuadSet2->QuadValue(iamp);
+ fQuadSet2->QuadValue(amp);
// fQuadSet2->QuadId(iid);
} // end clusters loop
//______________________________________________________________________________
void AliEveEMCALSModule::SetSModuleID(Int_t id)
{
- // Set id of chamber to display.
+ //
+ // Set id of the SM to display.
+ //
if (id < 0) id = 0;
if (id > 12) id = 12;
void UpdateQuads();
protected:
- AliEveEMCALData *fEMCALData; // data for the current event
- AliEveEMCALSModuleData *fEMCALSModuleData; // data of super module
- Color_t fFrameColor; // main coloring
- UInt_t fRTS; //! Rendering Time Stamp
- Int_t fSModuleID; // Id of super module, 0 to 11
- TEveQuadSet *fQuadSet; // 1st cathode plane digits
- TEveQuadSet *fQuadSet2; // 2nd cathode plane digits
- TEvePointSet *fPointSet; // reconstructed points (1st cathode)
- Short_t fThreshold; // digit amplitude threshold
- Int_t fMaxVal; // digit amplitude maximum value
- Int_t fClusterSize; // cluster point size
- Int_t fHitSize; // hit point size
- mutable UChar_t *fColorArray; // color-cache
- Int_t fDebug; // Debug option
-
- Float_t fSMBigBBox[3];
- Float_t fSMSmallBBox[3];
- Float_t fSMBBoxCenter[3];
-
- static TEveFrameBox *fFrameBigBox; // Frame box per super module
- static TEveFrameBox *fFrameSmallBox; // Frame box per super module
- static TEveRGBAPalette *fFrameDigPalette; // Signal to color mapping for EMCAL
- static TEveRGBAPalette *fFrameCluPalette; // Signal to color mapping for EMCAL
+ AliEveEMCALData *fEMCALData; // Data for the current event
+ AliEveEMCALSModuleData *fEMCALSModuleData; // Data of Super Module (SM)
+ Color_t fFrameColor; // Main coloring
+ UInt_t fRTS; //! Rendering Time Stamp
+ Int_t fSModuleID; // Id of super module, 0 to 11
+ TEveQuadSet *fQuadSet; // Digit container
+ TEveQuadSet *fQuadSet2; // Cluster container
+ TEvePointSet *fPointSet; // Hit container
+ Short_t fThreshold; // Digit amplitude threshold
+ Int_t fMaxVal; // Digit amplitude maximum value
+ Int_t fClusterSize; // Cluster point size
+ Int_t fHitSize; // Hit point size
+ mutable UChar_t *fColorArray; // Color-cache
+ Int_t fDebug; // Debug option
+
+ Float_t fSMBigBBox[3]; // Bounding Box of full SM
+ Float_t fSMSmallBBox[3]; // Bounding Box of half SM
+ Float_t fSMBBoxCenter[3]; // Bounding Box Center of full SM
+
+ static Bool_t fStaticInit; // Flag for static variable initialization.
+ static TEveFrameBox *fFrameBigBox; // Frame box per full SM
+ static TEveFrameBox *fFrameSmallBox; // Frame box per half SM
+ static TEveRGBAPalette *fFrameDigPalette; // Signal to color mapping for EMCAL digits
+ static TEveRGBAPalette *fFrameCluPalette; // Signal to color mapping for EMCAL clusters
void SetupColor(Int_t val, UChar_t* pix) const;
//**********************************
private:
- AliEveEMCALSModule(const AliEveEMCALSModule&); // Not implemented
+ AliEveEMCALSModule(const AliEveEMCALSModule&);
AliEveEMCALSModule& operator=(const AliEveEMCALSModule&); // Not implemented
ClassDef(AliEveEMCALSModule, 0); // Base class for TRD hits visualisation
#include <EveBase/AliEveEventManager.h>
-///////////////////////////////////////////////////////////////////////////////
-///
-/// AliEveEMCALSModuleData: geometry and digits
-///
-///////////////////////////////////////////////////////////////////////////////
-
-
ClassImp(AliEveEMCALSModuleData)
Float_t AliEveEMCALSModuleData::fSModuleBigBox0 = 0.;
fHMatrix(m)
{
//
- // constructor
+ // Constructor
//
Init(sm);
fHMatrix(esmdata.fHMatrix)
{
//
- // constructor
+ // Copy constructor
//
Init(esmdata.fNsm);
AliEveEMCALSModuleData::~AliEveEMCALSModuleData()
{
//
- // destructor
+ // Destructor
//
if(!fHitArray.empty()){
void AliEveEMCALSModuleData::DropData()
{
//
- // release the sm data
+ // Release the SM data
//
fNDigits = 0;
// ______________________________________________________________________________
void AliEveEMCALSModuleData::Init(Int_t sm)
{
+
+ //
+ // Initialize parameters
+ //
+
fNsm = 12;
fNsmfull = 10;
fNsmhalf = 2;
// ______________________________________________________________________________
-void AliEveEMCALSModuleData::RegisterDigit(Int_t AbsId, Int_t isupMod, Float_t iamp, Float_t ix, Float_t iy, Float_t iz)
+void AliEveEMCALSModuleData::RegisterDigit(Int_t AbsId, Int_t isupMod, Double_t iamp, Double_t ix, Double_t iy, Double_t iz)
{
//
- // add a digit to this sm
+ // Add a digit to this SM
//
- vector<Float_t> bufDig(6);
+ vector<Double_t> bufDig(6);
bufDig[0] = AbsId;
bufDig[1] = isupMod;
bufDig[2] = iamp;
bufDig[4] = iy;
bufDig[5] = iz;
- cout << "bufDig[0]: " << bufDig[0] << ", bufDig[1]: " << bufDig[1] << ", bufDig[2]: " << bufDig[2] <<
- ", bufDig[3]: " << bufDig[3] << ", bufDig[4]: " << bufDig[4] << ", bufDig[5]: " << bufDig[5] << endl;
-
fDigitArray.push_back(bufDig);
fNDigits++;
}
// ______________________________________________________________________________
-void AliEveEMCALSModuleData::RegisterHit(Int_t AbsId, Int_t isupMod, Float_t iamp, Float_t ix, Float_t iy, Float_t iz)
+void AliEveEMCALSModuleData::RegisterHit(Int_t AbsId, Int_t isupMod, Double_t iamp, Double_t ix, Double_t iy, Double_t iz)
{
//
- // add a hit to this sm
+ // Add a hit to this SM
//
vector<Float_t> bufHit(6);
}
// ______________________________________________________________________________
-void AliEveEMCALSModuleData::RegisterCluster(Int_t isupMod, Float_t iamp, Float_t ix, Float_t iy, Float_t iz)
+void AliEveEMCALSModuleData::RegisterCluster(Int_t isupMod, Double_t iamp, Double_t ix, Double_t iy, Double_t iz)
{
//
- // add a cluster to this sm
+ // Add a cluster to this SM
//
- vector<Float_t> bufClu(5);
+ vector<Double_t> bufClu(5);
bufClu[0] = isupMod;
bufClu[1] = iamp;
bufClu[2] = ix;
AliEveEMCALSModuleData(Int_t chamber,AliEMCALGeometry* geom,TGeoNode* node, TGeoHMatrix* m);
virtual ~AliEveEMCALSModuleData();
- void DropData();
-
- void Init(Int_t sm);
-
- void RegisterDigit(Int_t AbsId, Int_t isupMod, Float_t iamp, Float_t ix, Float_t iy, Float_t iz);
- void RegisterCluster(Int_t isupMod, Float_t iamp, Float_t ix, Float_t iy, Float_t iz);
- void RegisterHit(Int_t AbsId, Int_t isupMod, Float_t iamp, Float_t ix, Float_t iy, Float_t iz);
-
- Int_t GetNDigits() const { return fNDigits; };
- Int_t GetNClusters() const { return fNClusters; };
- Int_t GetNHits() const { return fNHits; };
- Int_t GetSmId() const { return fSmId; };
- Int_t GetNsm() const {return fNsm;};
- Int_t GetNsmf() const {return fNsmfull;};
- Int_t GetNsmh() const {return fNsmhalf;};
- vector< vector<Float_t> > GetDigitBuffer() { return fDigitArray; };
- vector< vector<Float_t> > GetClusterBuffer() { return fClusterArray; };
+ void DropData();
+ void Init(Int_t sm);
+ void RegisterDigit(Int_t AbsId, Int_t isupMod, Double_t iamp, Double_t ix, Double_t iy, Double_t iz);
+ void RegisterCluster(Int_t isupMod, Double_t iamp, Double_t ix, Double_t iy, Double_t iz);
+ void RegisterHit(Int_t AbsId, Int_t isupMod, Double_t iamp, Double_t ix, Double_t iy, Double_t iz);
+ Int_t GetNDigits() const { return fNDigits; };
+ Int_t GetNClusters() const { return fNClusters; };
+ Int_t GetNHits() const { return fNHits; };
+ Int_t GetSmId() const { return fSmId; };
+ Int_t GetNsm() const {return fNsm;};
+ Int_t GetNsmf() const {return fNsmfull;};
+ Int_t GetNsmh() const {return fNsmhalf;};
+ vector< vector<Double_t> > GetDigitBuffer() { return fDigitArray; };
+ vector< vector<Double_t> > GetClusterBuffer() { return fClusterArray; };
vector< vector<Float_t> > GetHitBuffer() { return fHitArray; };
- void GetSModuleBigBox(Float_t& bbox0, Float_t& bbox1, Float_t& bbox2)
+ void GetSModuleBigBox(Float_t& bbox0, Float_t& bbox1, Float_t& bbox2)
{ bbox0 = fSModuleBigBox0; bbox1 = fSModuleBigBox1; bbox2 = fSModuleBigBox2;};
- void GetSModuleSmallBox(Float_t& bbox0, Float_t& bbox1, Float_t& bbox2)
+ void GetSModuleSmallBox(Float_t& bbox0, Float_t& bbox1, Float_t& bbox2)
{ bbox0 = fSModuleSmallBox0; bbox1 = fSModuleSmallBox1; bbox2 = fSModuleSmallBox2;};
- void GetSModuleCenter(Float_t& bboxCenter0, Float_t& bboxCenter1, Float_t& bboxCenter2)
+ void GetSModuleCenter(Float_t& bboxCenter0, Float_t& bboxCenter1, Float_t& bboxCenter2)
{ bboxCenter0 = fSModuleCenter0; bboxCenter1 = fSModuleCenter1; bboxCenter2 = fSModuleCenter2;};
- Float_t GetPhiTileSize() {return fPhiTileSize;};
- Float_t GetEtaTileSize() {return fEtaTileSize;};
+ Float_t GetPhiTileSize() {return fPhiTileSize;};
+ Float_t GetEtaTileSize() {return fEtaTileSize;};
TGeoMatrix* GetSModuleMatrix() {return fMatrix;};
-protected:
-
- AliEMCALGeometry* fGeom;
- TGeoNode* fNode;
- Int_t fSmId; // number of the chamber, 0 to 13
- Int_t fNsm;
- Int_t fNsmfull;
- Int_t fNsmhalf;
- Int_t fNDigits; // number of found digits
- Int_t fNClusters; // number of found rec points
- Int_t fNHits; // number of simulation hits
-
- Float_t fPhiTileSize;
- Float_t fEtaTileSize;
-
- vector< vector<Float_t> > fHitArray; //|| hits coordinates, etc.
- vector< vector<Float_t> > fDigitArray; //|| digits coordinates, etc.
- vector< vector<Float_t> > fClusterArray; //|| cluster coordinates, etc.
-
- static Float_t fSModuleBigBox0; // sm envelope box
- static Float_t fSModuleBigBox1; // sm envelope box
- static Float_t fSModuleBigBox2; // sm envelope box
- static Float_t fSModuleSmallBox0; // sm envelope box
- static Float_t fSModuleSmallBox1; // sm envelope box
- static Float_t fSModuleSmallBox2; // sm envelope box
- static Float_t fSModuleCenter0; // sm envelope box
- static Float_t fSModuleCenter1; // sm envelope box
- static Float_t fSModuleCenter2; // sm envelope box
-
- TGeoMatrix* fMatrix;
- TGeoHMatrix* fHMatrix;
-
-private:
-
- AliEveEMCALSModuleData(const AliEveEMCALSModuleData&); // Not implemented
+ protected:
+ AliEMCALGeometry* fGeom; // Data member to set/call EMCAL geometry
+ TGeoNode* fNode; // Node for bbox definition
+ Int_t fSmId; // number of the chamber, 0 to 13
+ Int_t fNsm; // Total number of super modules
+ Int_t fNsmfull; // Number of full super modules
+ Int_t fNsmhalf; // Number of half super modules
+ Int_t fNDigits; // number of found digits
+ Int_t fNClusters; // number of found rec points
+ Int_t fNHits; // number of simulation hits
+
+ Float_t fPhiTileSize; // Typical phi size of a QuadSet (digit)
+ Float_t fEtaTileSize; // Typical eta size of a QuadSet (digit)
+
+ vector< vector<Float_t> > fHitArray; //|| Hit coordinates, etc.
+ vector< vector<Double_t> > fDigitArray; //|| Digit coordinates, etc.
+ vector< vector<Double_t> > fClusterArray; //|| Rec point coordinates, etc.
+
+ static Float_t fSModuleBigBox0; // SM envelope box
+ static Float_t fSModuleBigBox1; // SM envelope box
+ static Float_t fSModuleBigBox2; // SM envelope box
+ static Float_t fSModuleSmallBox0; // SM envelope box
+ static Float_t fSModuleSmallBox1; // SM envelope box
+ static Float_t fSModuleSmallBox2; // SM envelope box
+ static Float_t fSModuleCenter0; // SM envelope box
+ static Float_t fSModuleCenter1; // SM envelope box
+ static Float_t fSModuleCenter2; // SM envelope box
+
+ TGeoMatrix* fMatrix; // Matrix for local to global transformation
+ TGeoHMatrix* fHMatrix; // Matrix for local to global transformation
+
+ private:
+ AliEveEMCALSModuleData(const AliEveEMCALSModuleData&);
AliEveEMCALSModuleData& operator=(const AliEveEMCALSModuleData&); // Not implemented
-
+
ClassDef(AliEveEMCALSModuleData, 0); // class with data for one chamber
};
emcal_data = new AliEveEMCALData(rl,node,m);
emcal_data->SetESD(esd);
// RunLoader information
- emcal_data->LoadHits(ht); // Does not work per sm but ok for all emcal
- emcal_data->LoadDigits(dt);
- emcal_data->LoadRecPoints(rt);
+// emcal_data->LoadHits(ht); // Does not work with my aliroot version ?
+// emcal_data->LoadDigits(dt);
+// emcal_data->LoadRecPoints(rt);
// To be uncommented if use of emcalLoader
- // rl->GetEvent(evtNum);
- // emcal_data->LoadHitsFromEMCALLoader(emcl); // Does not work
- // emcal_data->LoadDigitsFromEMCALLoader(emcl);
- // emcal_data->LoadRecPointsFromEMCALLoader(emcl);
+ rl->GetEvent(evtNum);
+ emcal_data->LoadHitsFromEMCALLoader(emcl);
+// emcal_data->LoadDigitsFromEMCALLoader(emcl);
+// emcal_data->LoadRecPointsFromEMCALLoader(emcl);
// To be uncommented to read esds
- // emcal_data->LoadDigitsFromESD();
- // emcal_data->LoadRecPointsFromESD();
+ emcal_data->LoadDigitsFromESD();
+ emcal_data->LoadRecPointsFromESD();
gStyle->SetPalette(1, 0);
gEve->Redraw3D(kTRUE);
gEve->EnableRedraw();
+
+
}