* full copyright notice. *
**************************************************************************/
-#include <TMath.h>
-#include <TVector3.h>
+#include "AliEveITSDigitsInfo.h"
+#include <EveBase/AliEveEventManager.h>
-#include <TEveTreeTools.h>
-#include <TEveTrans.h>
+#include <AliITS.h>
+#include <AliITSInitGeometry.h>
+#include <AliITSgeomTGeo.h>
+#include <AliITSsegmentationSPD.h>
+#include <AliITSsegmentationSDD.h>
+#include <AliITSsegmentationSSD.h>
+#include <AliITSDDLModuleMapSDD.h>
-#include "AliEveITSDigitsInfo.h"
#include <AliITSCalibrationSDD.h>
#include <AliITSdigit.h>
#include <AliITSdigitSPD.h>
+#include <AliCDBEntry.h>
+#include <AliCDBManager.h>
+
#include <AliRawReader.h>
#include <AliITSRawStreamSPD.h>
#include <AliITSRawStreamSDD.h>
#include <AliITSRawStreamSSD.h>
+#include <TGeoMatrix.h>
+#include <TEveTrans.h>
+//#include <TClonesArray.h>
+
+#include <TMath.h>
+#include <TVector3.h>
+
+//==============================================================================
+//==============================================================================
+// AliEveITSModuleSelection
+//==============================================================================
+
//______________________________________________________________________________
//
// Helper for selecting a range of ITS modules by type, layer, phi and
}
+//==============================================================================
+//==============================================================================
+// AliEveITSDigitsInfo
+//==============================================================================
+
//______________________________________________________________________________
//
// Stores ITS geometry information and event-data in format suitable
TEveRefCnt(),
fSPDmap(), fSDDmap(), fSSDmap(),
fTree (0),
- fGeom (0),
- fSegSPD(0), fSegSDD(0), fSegSSD(0)
+ fSegSPD (0), fSegSDD (0), fSegSSD (0),
+ fDDLMapSDD (0),
+ fSPDMinVal (0), fSSDMinVal (0), fSDDMinVal (0),
+ fSPDMaxVal (0), fSSDMaxVal (0), fSDDMaxVal (0),
+ fSPDHighLim (0), fSDDHighLim (0), fSSDHighLim (0)
{
// Default constructor.
// module-id to transformation-matrix mapping and segmentation
// classes and data-structures.
- static const TEveException eH("AliEveITSDigitsInfo::InitInternals ");
+ static const TEveException kEH("AliEveITSDigitsInfo::InitInternals ");
- fGeom = new AliITSgeom();
- fGeom->ReadNewFile("$REVESYS/alice-data/ITSgeometry.det");
- if (fGeom == 0)
- throw(eH + "can not load ITS geometry \n");
+ AliEveEventManager::AssertGeometry();
SetITSSegmentation();
fSSDScale[2] = 9;
fSSDScale[3] = 20;
fSSDScale[4] = 30;
+
+ fDDLMapSDD = new AliITSDDLModuleMapSDD();
+ AliCDBManager *man = AliCDBManager::Instance();
+ AliCDBEntry *ddlMapSDD = man->Get("ITS/Calib/DDLMapSDD");
+ ddlMapSDD->SetOwner(kTRUE);
+ if (!ddlMapSDD) {
+ AliWarning("SDD DDL map file retrieval from OCDB failed! - Use default DDL map");
+ } else {
+ AliITSDDLModuleMapSDD *ddlsdd = (AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject();
+ if (!ddlsdd) {
+ AliWarning("SDD DDL map object not found in OCDB file! - Use default DDL map");
+ } else {
+ fDDLMapSDD->SetDDLMap(ddlsdd);
+ }
+ }
+ delete ddlMapSDD;
}
/******************************************************************************/
// Destructor.
// Deletes the data-maps and the tree.
- map<Int_t, TClonesArray*>::iterator j;
- for(j = fSPDmap.begin(); j != fSPDmap.end(); ++j)
+ std::map<Int_t, TClonesArray*>::iterator j;
+ for (j = fSPDmap.begin(); j != fSPDmap.end(); ++j)
delete j->second;
- for(j = fSDDmap.begin(); j != fSDDmap.end(); ++j)
+ for (j = fSDDmap.begin(); j != fSDDmap.end(); ++j)
delete j->second;
- for(j = fSSDmap.begin(); j != fSSDmap.end(); ++j)
+ for (j = fSSDmap.begin(); j != fSSDmap.end(); ++j)
delete j->second;
-
+ delete fDDLMapSDD;
delete fSegSPD; delete fSegSDD; delete fSegSSD;
- delete fGeom;
delete fTree;
}
// Read raw-data into internal structures. AliITSdigit is used to
// store raw-adata for all sub-detectors.
- if ((mode & 1) || (mode & 2)){
+ if ((mode & 1) || (mode & 2))
+ {
AliITSRawStreamSPD inputSPD(raw);
TClonesArray* digits = 0;
while (inputSPD.Next())
raw->Reset();
}
- if ((mode & 4) || (mode & 8)){
+ if ((mode & 4) || (mode & 8))
+ {
AliITSRawStreamSDD input(raw);
+ input.SetDDLModuleMap(fDDLMapSDD);
TClonesArray* digits = 0;
while (input.Next())
{
Int_t module = input.GetModuleID();
- Int_t anode = input.GetAnode();
- Int_t time = input.GetTime();
- Int_t signal = input.GetSignal();
if (input.IsNewModule())
{
fSDDmap[module] = digits = new TClonesArray("AliITSdigit", 0);
}
- AliITSdigit* d = new ((*digits)[digits->GetEntriesFast()]) AliITSdigit();
- d->SetCoord1(anode);
- d->SetCoord2(time);
- d->SetSignal(signal);
-
+ if (input.IsCompletedModule()==kFALSE)
+ {
+ Int_t anode = input.GetAnode()+input.GetChannel()*AliITSsegmentationSDD::GetNAnodesPerHybrid();
+ Int_t time = input.GetTime();
+ Int_t signal = input.GetSignal();
+ AliITSdigit* d = new ((*digits)[digits->GetEntriesFast()]) AliITSdigit();
+ d->SetCoord1(anode);
+ d->SetCoord2(time);
+ d->SetSignal(signal);
+ }
// printf("SDD: %d %d %d %d\n",module,anode,time,signal);
}
raw->Reset();
}
- if ((mode & 16) || (mode & 32)){
+ if ((mode & 16) || (mode & 32))
+ {
AliITSRawStreamSSD input(raw);
TClonesArray* digits = 0;
while (input.Next())
Int_t strip = input.GetStrip();
Int_t signal = input.GetSignal();
- if (input.IsNewModule())
+ // !!!! IsNewModule() is false in the beginning of the stream, so we also
+ // !!!! check for digits == 0. Should be fixed in SSD stream.
+ if (input.IsNewModule() || digits == 0)
{
digits = fSSDmap[module];
if (digits == 0)
// data-structures.
// SPD
- fSegSPD = new AliITSsegmentationSPD(fGeom);
+ fSegSPD = new AliITSsegmentationSPD("TGeo");
Int_t m;
Float_t fNzSPD=160;
}
// SDD
- fSegSDD = new AliITSsegmentationSDD(fGeom);
+ fSegSDD = new AliITSsegmentationSDD("TGeo");
+ // !!!! Set default drift speed, eventually need to get it from CDB.
+ fSegSDD->SetDriftSpeed(7.3);
// SSD
- fSegSSD = new AliITSsegmentationSSD(fGeom);
+ fSegSSD = new AliITSsegmentationSSD("TGeo");
}
/******************************************************************************/
case 0:
{
TClonesArray* digitsSPD = 0;
- map<Int_t, TClonesArray*>::iterator i = fSPDmap.find(mod);
+ std::map<Int_t, TClonesArray*>::iterator i = fSPDmap.find(mod);
if (i == fSPDmap.end()) {
if (fTree) {
TBranch* br = fTree->GetBranch("ITSDigitsSPD");
case 1:
{
TClonesArray* digitsSDD = 0;
- map<Int_t, TClonesArray*>::iterator i = fSDDmap.find(mod);
+ std::map<Int_t, TClonesArray*>::iterator i = fSDDmap.find(mod);
if (i == fSDDmap.end()) {
if (fTree) {
TBranch* br = fTree->GetBranch("ITSDigitsSDD");
case 2:
{
TClonesArray* digitsSSD = 0;
- map<Int_t, TClonesArray*>::iterator i = fSSDmap.find(mod);
+ std::map<Int_t, TClonesArray*>::iterator i = fSSDmap.find(mod);
if (i == fSSDmap.end()) {
if (fTree) {
TBranch* br = fTree->GetBranch("ITSDigitsSSD");
{
case 0:
idx0 = 0;
- idx1 = fGeom->GetLastSPD();
+ idx1 = AliITSgeomTGeo::GetModuleIndex(3, 1, 1) - 1;
break;
case 1:
- idx0 = fGeom->GetLastSPD()+1;
- idx1 = fGeom->GetLastSDD();
+ idx0 = AliITSgeomTGeo::GetModuleIndex(3, 1, 1);
+ idx1 = AliITSgeomTGeo::GetModuleIndex(5, 1, 1) - 1;
break;
case 2:
- idx0 = fGeom->GetLastSDD()+1;
- idx1 = fGeom->GetLastSSD();
+ idx0 = AliITSgeomTGeo::GetModuleIndex(5, 1, 1);
+ idx1 = AliITSgeomTGeo::GetNModules() - 1;
break;
default:
idx1 = 0;
- idx1 = fGeom->GetLastSSD();
+ idx1 = AliITSgeomTGeo::GetNModules() - 1;
break;
}
- TVector3 v;
- Double_t x[9];
- Int_t lay, lad, det;
+ TVector3 v;
TEveTrans mx;
- for (Int_t id = idx0; id<idx1; ++id)
+ Int_t lay, lad, det;
+ for (Int_t id = idx0; id < idx1; ++id)
{
- fGeom->GetModuleId(id, lay, lad, det);
+ AliITSgeomTGeo::GetModuleId(id, lay, lad, det);
if (sel->GetLayer() == lay || sel->GetLayer() == -1)
{
// check data from matrix
- mx.UnitTrans();
- fGeom->GetRotMatrix(id, x);
- mx.SetBaseVec(1, x[0], x[3], x[6]);
- mx.SetBaseVec(2, x[1], x[4], x[7]);
- mx.SetBaseVec(3, x[2], x[5], x[8]);
- fGeom->GetTrans(id, x);
- mx.SetBaseVec(4, x);
+ mx.SetFrom(*AliITSgeomTGeo::GetMatrix(id));
mx.GetPos(v);
if (v.Phi() <= sel->GetMaxPhi() && v.Phi() >= sel->GetMinPhi() &&
v.Theta() <= sel->GetMaxTheta() && v.Theta() >= sel->GetMinTheta())
printf("*********************************************************\n");
printf("SPD module dimension (%f,%f)\n", fSegSPD->Dx()*0.0001, fSegSPD->Dz()*0.0001);
- printf("SPD first,last module:: %d,%d\n", fGeom->GetStartSPD(), fGeom->GetLastSPD() );
+ printf("SPD first,last module: %d, %d\n",
+ AliITSgeomTGeo::GetModuleIndex(1,1,1),
+ AliITSgeomTGeo::GetModuleIndex(3,1,1) - 1);
printf("SPD num cells per module (x::%d,z::%d)\n", fSegSPD->Npx(), fSegSPD->Npz());
Int_t iz = 0, ix = 0;
printf("SPD dimesion of (%d,%d) in pixel(%f,%f)\n", ix, iz, fSegSPD->Dpx(ix), fSegSPD->Dpz(iz));
printf("*********************************************************\n");
printf("SDD module dimension (%f,%f)\n", fSegSDD->Dx()*0.0001, fSegSDD->Dz()*0.0001);
- printf("SDD first,last module:: %d,%d\n", fGeom->GetStartSDD(), fGeom->GetLastSDD());
+ printf("SDD first,last module: %d, %d\n",
+ AliITSgeomTGeo::GetModuleIndex(3,1,1),
+ AliITSgeomTGeo::GetModuleIndex(5,1,1) - 1);
printf("SDD num cells per module (x::%d,z::%d)\n", fSegSDD->Npx(), fSegSDD->Npz());
printf("SDD dimesion of pixel are (%f,%f)\n", fSegSDD->Dpx(1)*0.001, fSegSDD->Dpz(1)*0.001);
Float_t ap, an;
printf("*********************************************************\n");
printf("SSD module dimension (%f,%f)\n", fSegSSD->Dx()*0.0001, fSegSSD->Dz()*0.0001);
- printf("SSD first,last module:: %d,%d\n", fGeom->GetStartSSD(), fGeom->GetLastSSD() );
+ printf("SSD first, last module: %d, %d\n",
+ AliITSgeomTGeo::GetModuleIndex(5,1,1),
+ AliITSgeomTGeo::GetNModules() - 1);
printf("SSD strips in module %d\n", fSegSSD->Npx());
printf("SSD strip sizes are (%f,%f)\n", fSegSSD->Dpx(1), fSegSSD->Dpz(1));
fSegSSD->SetLayer(5); fSegSSD->Angles(ap,an);