* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
+ * Conributors are mentioned in the code where appropriate. *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
#include "AliCDBManager.h"
#include "AliCDBStorage.h"
#include "AliCDBEntry.h"
-
#include "AliITSClusterFinder.h"
#include "AliITSClusterFinderV2.h"
#include "AliITSClusterFinderV2SPD.h"
#include "AliITSClusterFinderSPD.h"
#include "AliITSClusterFinderSDD.h"
#include "AliITSClusterFinderSSD.h"
-#include "AliITSclusterV2.h"
-#include "AliITSgeom.h"
#include "AliITSDetTypeRec.h"
#include "AliITSRawCluster.h"
#include "AliITSRawClusterSPD.h"
#include "AliITSRawClusterSDD.h"
#include "AliITSRawClusterSSD.h"
#include "AliITSRecPoint.h"
-#include "AliITSresponseSDD.h"
+#include "AliITSCalibrationSDD.h"
#include "AliITSsegmentationSPD.h"
#include "AliITSsegmentationSDD.h"
#include "AliITSsegmentationSSD.h"
+#include "AliLog.h"
const Int_t AliITSDetTypeRec::fgkNdettypes = 3;
//________________________________________________________________
AliITSDetTypeRec::AliITSDetTypeRec(): TObject(),
-fGeom(), //
-fReconstruction(),// [NDet]
-fSegmentation(), // [NDet]
-fCalibration(), // [NMod]
-fPreProcess(), // [] e.g. Find Calibration values
-fPostProcess(), // [] e.g. find primary vertex
-fDigits(), //! [NMod][NDigits]
-fClusterClassName(), // String with Cluster class name
-fDigClassName(), // String with digit class name.
-fRecPointClassName(){// String with RecPoint class name
+fNMod(0),
+fReconstruction(0),
+fSegmentation(0),
+fCalibration(0),
+fPreProcess(0),
+fPostProcess(0),
+fDigits(0),
+fNdtype(0),
+fCtype(0),
+fNctype(0),
+fRecPoints(0),
+fNRecPoints(0),
+fSelectedVertexer(),
+fLoader(0),
+fRunNumber(0),
+fFirstcall(kTRUE){
// Default Constructor
// Inputs:
// none.
// Return:
// A properly zero-ed AliITSDetTypeRec class.
- fGeom = 0;
+ for(Int_t i=0; i<3; i++){
+ fClusterClassName[i]=0;
+ fDigClassName[i]=0;
+ fRecPointClassName[i]=0;
+ }
+
+ SelectVertexer(" ");
+
+
+}
+//________________________________________________________________
+AliITSDetTypeRec::AliITSDetTypeRec(AliITSLoader *loader): TObject(),
+fNMod(0),
+fReconstruction(0),
+fSegmentation(0),
+fCalibration(0),
+fPreProcess(0),
+fPostProcess(0),
+fDigits(0),
+fNdtype(0),
+fCtype(0),
+fNctype(0),
+fRecPoints(0),
+fNRecPoints(0),
+fSelectedVertexer(),
+fLoader(loader),
+fRunNumber(0),
+fFirstcall(kTRUE){
+ // Standard Constructor
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ //
+
fReconstruction = new TObjArray(fgkNdettypes);
- fSegmentation = 0;
- fCalibration = 0;
- fPreProcess = 0;
- fPostProcess = 0;
fDigits = new TObjArray(fgkNdettypes);
+ for(Int_t i=0; i<3; i++){
+ fClusterClassName[i]=0;
+ fDigClassName[i]=0;
+ fRecPointClassName[i]=0;
+ }
fNdtype = new Int_t[fgkNdettypes];
fCtype = new TObjArray(fgkNdettypes);
fNctype = new Int_t[fgkNdettypes];
- fRecPoints = new TClonesArray("AliITSRecPoint",1000);
+ fNMod = new Int_t [fgkNdettypes];
+ fNMod[0] = fgkDefaultNModulesSPD;
+ fNMod[1] = fgkDefaultNModulesSDD;
+ fNMod[2] = fgkDefaultNModulesSSD;
+ fRecPoints = new TClonesArray("AliITSRecPoint",3000);
fNRecPoints = 0;
- fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
- fNClustersV2 = 0;
for(Int_t i=0;i<fgkNdettypes;i++){
fNdtype[i]=0;
fNctype[i]=0;
}
- SelectVertexer(" ");
- fLoader = 0;
-
- fNMod[0] = fgkDefaultNModulesSPD;
- fNMod[1] = fgkDefaultNModulesSDD;
- fNMod[2] = fgkDefaultNModulesSSD;
-
+ SelectVertexer(" ");
SetRunNumber();
}
+
//______________________________________________________________________
-AliITSDetTypeRec::AliITSDetTypeRec(const AliITSDetTypeRec &/*rec*/):TObject(/*rec*/){
- // Copy constructor.
+AliITSDetTypeRec::AliITSDetTypeRec(const AliITSDetTypeRec & rec):TObject(rec),
+fNMod(rec.fNMod),
+fReconstruction(rec.fReconstruction),
+fSegmentation(rec.fSegmentation),
+fCalibration(rec.fCalibration),
+fPreProcess(rec.fPreProcess),
+fPostProcess(rec.fPostProcess),
+fDigits(rec.fDigits),
+fNdtype(rec.fNdtype),
+fCtype(rec.fCtype),
+fNctype(rec.fNctype),
+fRecPoints(rec.fRecPoints),
+fNRecPoints(rec.fNRecPoints),
+fSelectedVertexer(rec.fSelectedVertexer),
+fLoader(rec.fLoader),
+fRunNumber(rec.fRunNumber),
+fFirstcall(rec.fFirstcall)
+{
+
+ // Copy constructor.
- Error("Copy constructor","Copy constructor not allowed");
-
}
//______________________________________________________________________
-AliITSDetTypeRec& AliITSDetTypeRec::operator=(const AliITSDetTypeRec& /*source*/){
- // Assignment operator. This is a function which is not allowed to be
- // done.
- Error("operator=","Assignment operator not allowed\n");
- return *this;
+AliITSDetTypeRec& AliITSDetTypeRec::operator=(const AliITSDetTypeRec& source){
+ // Assignment operator.
+ this->~AliITSDetTypeRec();
+ new(this) AliITSDetTypeRec(source);
+ return *this;
+
}
//_____________________________________________________________________
AliITSDetTypeRec::~AliITSDetTypeRec(){
-
//Destructor
- if(fGeom) delete fGeom;
- if(fReconstruction) delete fReconstruction;
- if(fSegmentation) delete fSegmentation;
- if(fCalibration) delete fCalibration;
+
+ if(fReconstruction){
+ fReconstruction->Delete();
+ delete fReconstruction;
+ fReconstruction = 0;
+ }
+ if(fSegmentation){
+ fSegmentation->Delete();
+ delete fSegmentation;
+ fSegmentation = 0;
+ }
+ if(fCalibration && fRunNumber<0){
+ AliITSresponse* rspd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSPD()))->GetResponse();
+ AliITSresponse* rsdd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSDD()))->GetResponse();
+ AliITSresponse* rssd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSSD()))->GetResponse();
+ if(rspd) delete rspd;
+ if(rsdd) delete rsdd;
+ if(rssd) delete rssd;
+ fCalibration->Delete();
+ delete fCalibration;
+ fCalibration = 0;
+ }
if(fPreProcess) delete fPreProcess;
if(fPostProcess) delete fPostProcess;
delete fRecPoints;
fRecPoints=0;
}
- if(fClustersV2){
- fClustersV2->Delete();
- delete fClustersV2;
- fClustersV2=0;
- }
if(fCtype) {
fCtype->Delete();
delete fCtype;
}
delete [] fNctype;
delete [] fNdtype;
+ delete [] fNMod;
if(fLoader) delete fLoader;
}
+
//___________________________________________________________________
void AliITSDetTypeRec::SetReconstructionModel(Int_t dettype,AliITSClusterFinder *clf){
}
//_______________________________________________________________________
-void AliITSDetTypeRec::SetCalibrationModel(Int_t iMod, AliITSresponse *cal){
+void AliITSDetTypeRec::SetCalibrationModel(Int_t iMod, AliITSCalibration *cal){
//Set calibration (response) for the module iMod of type dettype
if (fCalibration==0) {
- fCalibration = new TObjArray(fGeom->GetIndexMax());
+ fCalibration = new TObjArray(GetITSgeom()->GetIndexMax());
fCalibration->SetOwner(kTRUE);
fCalibration->Clear();
}
if (fCalibration->At(iMod) != 0)
- delete (AliITSresponse*) fCalibration->At(iMod);
+ delete (AliITSCalibration*) fCalibration->At(iMod);
fCalibration->AddAt(cal,iMod);
}
//_______________________________________________________________________
-AliITSresponse* AliITSDetTypeRec::GetCalibrationModel(Int_t iMod){
+AliITSCalibration* AliITSDetTypeRec::GetCalibrationModel(Int_t iMod){
//Get calibration model for module type
return 0;
}
- return (AliITSresponse*)fCalibration->At(iMod);
+ return (AliITSCalibration*)fCalibration->At(iMod);
}
//______________________________________________________________________
//Set defaults for segmentation and response
- if(fGeom==0){
- Warning("SetDefaults","fGeom is 0!");
+ if(!GetITSgeom()){
+ Warning("SetDefaults","null pointer to AliITSgeomGeom !");
return;
}
for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
if(dettype==0){
- seg = new AliITSsegmentationSPD(fGeom);
+ seg = new AliITSsegmentationSPD(GetITSgeom());
SetSegmentationModel(dettype,seg);
SetDigitClassName(dettype,"AliITSdigitSPD");
SetClusterClassName(dettype,"AliITSRawClusterSPD");
}
if(dettype==1){
- AliITSresponseSDD* res=(AliITSresponseSDD*) GetCalibrationModel(fGeom->GetStartSDD());
- seg = new AliITSsegmentationSDD(fGeom,res);
+ AliITSCalibrationSDD* res=(AliITSCalibrationSDD*) GetCalibrationModel(GetITSgeom()->GetStartSDD());
+ seg = new AliITSsegmentationSDD(GetITSgeom(),res);
SetSegmentationModel(dettype,seg);
- const char *kopt = res->ZeroSuppOption();
+ const char *kopt = ((AliITSresponseSDD*)res->GetResponse())->ZeroSuppOption();
if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) SetDigitClassName(dettype,"AliITSdigit");
else SetDigitClassName(dettype,"AliITSdigitSDD");
SetClusterClassName(dettype,"AliITSRawClusterSDD");
}
if(dettype==2){
- AliITSsegmentationSSD* seg2 = new AliITSsegmentationSSD(fGeom);
+ AliITSsegmentationSSD* seg2 = new AliITSsegmentationSSD(GetITSgeom());
seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
Bool_t AliITSDetTypeRec::GetCalibration() {
// Get Default calibration if a storage is not defined.
-// Bool_t deleteManager = kFALSE;
-// if(!AliCDBManager::Instance()->IsDefaultStorageSet()) {
-// AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
-// deleteManager = kTRUE;
-// }
-// AliCDBStorage *storage = AliCDBManager::Instance()->GetDefaultStorage();
-
- AliCDBEntry *entrySPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD", fRunNumber);
- AliCDBEntry *entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD", fRunNumber);
- AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD", fRunNumber);
-
- if(!entrySPD || !entrySDD || !entrySSD){
- AliWarning("Calibration object retrieval failed! Dummy calibration will be used.");
- AliCDBStorage *origStorage = AliCDBManager::Instance()->GetDefaultStorage();
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
-
- entrySPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD", fRunNumber);
- entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD", fRunNumber);
- entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD", fRunNumber);
-
- AliCDBManager::Instance()->SetDefaultStorage(origStorage);
- }
-
-// AliCDBEntry *entrySPD = storage->Get("ITS/Calib/RespSPD", fRunNumber);
- TObjArray *respSPD = (TObjArray *)entrySPD->GetObject();
- entrySPD->SetObject(NULL);
+ if(!fFirstcall){
+ AliITSCalibration* cal = GetCalibrationModel(0);
+ if(cal)return kTRUE;
+ }
+ else {
+ fFirstcall = kFALSE;
+ }
+
+ SetRunNumber((Int_t)AliCDBManager::Instance()->GetRun());
+ Int_t run=GetRunNumber();
+
+ Bool_t origCacheStatus = AliCDBManager::Instance()->GetCacheFlag();
+ Bool_t isCacheActive = kTRUE;
+ if(GetRunNumber()<0)isCacheActive=kFALSE;
+ if (fCalibration==0) {
+ fCalibration = new TObjArray(GetITSgeom()->GetIndexMax());
+ fCalibration->SetOwner(isCacheActive);
+ fCalibration->Clear();
+ }
+
+ AliCDBManager::Instance()->SetCacheFlag(isCacheActive);
+
+ AliCDBEntry *entrySPD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSPD", run);
+ AliCDBEntry *entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD", run);
+ AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD", run);
+ AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD", run);
+ AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD", run);
+ AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD", run);
+
+ if(!entrySPD || !entrySDD || !entrySSD || !entry2SPD || !entry2SDD || !entry2SSD){
+ AliFatal("Calibration object retrieval failed! ");
+ return kFALSE;
+ }
+
+ TObjArray *calSPD = (TObjArray *)entrySPD->GetObject();
+ if(!isCacheActive)entrySPD->SetObject(NULL);
entrySPD->SetOwner(kTRUE);
-// AliCDBEntry *entrySDD = storage->Get("ITS/Calib/RespSDD", fRunNumber);
- TObjArray *respSDD = (TObjArray *)entrySDD->GetObject();
- entrySDD->SetObject(NULL);
+
+ AliITSresponseSPD *pSPD = (AliITSresponseSPD*)entry2SPD->GetObject();
+ if(!isCacheActive)entry2SPD->SetObject(NULL);
+ entry2SPD->SetOwner(kTRUE);
+
+ TObjArray *calSDD = (TObjArray *)entrySDD->GetObject();
+ if(!isCacheActive)entrySDD->SetObject(NULL);
entrySDD->SetOwner(kTRUE);
-// AliCDBEntry *entrySSD = storage->Get("ITS/Calib/RespSSD", fRunNumber);
- TObjArray *respSSD = (TObjArray *)entrySSD->GetObject();
- entrySSD->SetObject(NULL);
+
+ AliITSresponseSDD *pSDD = (AliITSresponseSDD*)entry2SDD->GetObject();
+ if(!isCacheActive)entry2SDD->SetObject(NULL);
+ entry2SDD->SetOwner(kTRUE);
+
+ TObjArray *calSSD = (TObjArray *)entrySSD->GetObject();
+ if(!isCacheActive)entrySSD->SetObject(NULL);
entrySSD->SetOwner(kTRUE);
- // DB entries are dleted. In this waymetadeta objects are deleted as well
- delete entrySPD;
- delete entrySDD;
- delete entrySSD;
-// if(deleteManager){
-// AliCDBManager::Instance()->Destroy();
-// AliCDBManager::Instance()->UnsetDefaultStorage();
-// storage = 0; // the storage is killed by AliCDBManager::Instance()->Destroy()
-// }
+ AliITSresponseSSD *pSSD = (AliITSresponseSSD*)entry2SSD->GetObject();
+ if(!isCacheActive)entry2SSD->SetObject(NULL);
+ entry2SSD->SetOwner(kTRUE);
+ // DB entries are deleted. In this way metadeta objects are deleted as well
+ if(!isCacheActive){
+ delete entrySPD;
+ delete entrySDD;
+ delete entrySSD;
+ delete entry2SPD;
+ delete entry2SDD;
+ delete entry2SSD;
+ }
- if ((! respSPD)||(! respSDD)||(! respSSD)) {
+ AliCDBManager::Instance()->SetCacheFlag(origCacheStatus);
+
+ if ((!pSPD)||(!pSDD)||(!pSSD) || (!calSPD) || (!calSDD) || (!calSSD)) {
AliWarning("Can not get calibration from calibration database !");
return kFALSE;
}
-
- fNMod[0] = respSPD->GetEntries();
- fNMod[1] = respSDD->GetEntries();
- fNMod[2] = respSSD->GetEntries();
+
+ fNMod[0] = calSPD->GetEntries();
+ fNMod[1] = calSDD->GetEntries();
+ fNMod[2] = calSSD->GetEntries();
AliInfo(Form("%i SPD, %i SDD and %i SSD in calibration database",
fNMod[0], fNMod[1], fNMod[2]));
- AliITSresponse* res;
+ AliITSCalibration* cal;
for (Int_t i=0; i<fNMod[0]; i++) {
- res = (AliITSresponse*) respSPD->At(i);
- SetCalibrationModel(i, res);
+ cal = (AliITSCalibration*) calSPD->At(i);
+ cal->SetResponse((AliITSresponse*)pSPD);
+ SetCalibrationModel(i, cal);
}
for (Int_t i=0; i<fNMod[1]; i++) {
- res = (AliITSresponse*) respSDD->At(i);
+ cal = (AliITSCalibration*) calSDD->At(i);
+ cal->SetResponse((AliITSresponse*)pSDD);
Int_t iMod = i + fNMod[0];
- SetCalibrationModel(iMod, res);
+ SetCalibrationModel(iMod, cal);
}
for (Int_t i=0; i<fNMod[2]; i++) {
- res = (AliITSresponse*) respSSD->At(i);
+ cal = (AliITSCalibration*) calSSD->At(i);
+ cal->SetResponse((AliITSresponse*)pSSD);
Int_t iMod = i + fNMod[0] + fNMod[1];
- SetCalibrationModel(iMod, res);
+ SetCalibrationModel(iMod, cal);
}
return kTRUE;
//set defaults for standard cluster finder
- if(fGeom==0){
- Warning("SetDefaults","fGeom is 0!");
+ if(!GetITSgeom()){
+ Warning("SetDefaults","null pointer to AliITSgeom!");
return;
}
//Set defaults for cluster finder V2
- if(fGeom==0){
- Warning("SetDefaults","fGeom is 0!");
+ if(!GetITSgeom()){
+ Warning("SetDefaults","Null pointer to AliITSgeom !");
return;
}
//Creates branches for clusters and recpoints
Bool_t cR = (strstr(option,"R")!=0);
Bool_t cRF = (strstr(option,"RF")!=0);
- Bool_t v2 = (strstr(option,"v2")!=0);
if(cRF)cR = kFALSE;
if(cR) MakeBranchR(0);
if(cRF) MakeBranchRF(0);
- if(v2) MakeBranchR(0,"v2");
}
// only one branch for rec points for all detector types
Bool_t oFast= (strstr(opt,"Fast")!=0);
- Bool_t v2 = (strstr(opt,"v2")!=0);
Char_t detname[10] = "ITS";
if(oFast){
sprintf(branchname,"%sRecPointsF",detname);
- } else if(v2){
- sprintf(branchname,"Clusters");
} else {
sprintf(branchname,"%sRecPoints",detname);
}
- if(v2){
-
- if(!fClustersV2)fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
- if(fLoader->TreeR()){
- if(fClustersV2==0x0) fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
- MakeBranchInTree(fLoader->TreeR(),branchname,0,&fClustersV2,buffsz,99,file);
-
- }
- }else{
- if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
- if (fLoader->TreeR()) {
- if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",
- 1000);
- MakeBranchInTree(fLoader->TreeR(),branchname,0,&fRecPoints,buffsz,99,file);
- } // end if
- }
+ if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
+ if (fLoader->TreeR()) {
+ if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",
+ 1000);
+ MakeBranchInTree(fLoader->TreeR(),branchname,0,&fRecPoints,buffsz,99,file);
+ } // end if
+
}
//______________________________________________________________________
if(!treeR) return;
if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
- TBranch *branch1;
- sprintf(branchname,"Clusters");
- branch1 = treeR->GetBranch(branchname);
- if(branch1){
- if(fClustersV2==0x0) fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
- branch1->SetAddress(&fClustersV2);
- }
- else{
- TBranch *branch;
- sprintf(branchname,"%sRecPoints",namedet);
+ TBranch *branch;
+ sprintf(branchname,"%sRecPoints",namedet);
+ branch = treeR->GetBranch(branchname);
+ if (branch) {
+ branch->SetAddress(&fRecPoints);
+ }else {
+ sprintf(branchname,"%sRecPointsF",namedet);
branch = treeR->GetBranch(branchname);
if (branch) {
- branch->SetAddress(&fRecPoints);
- }else {
- sprintf(branchname,"%sRecPointsF",namedet);
- branch = treeR->GetBranch(branchname);
- if (branch) {
- branch->SetAddress(&fRecPoints);
- }
+ branch->SetAddress(&fRecPoints);
}
+
}
}
//____________________________________________________________________
TClonesArray &lrecp = *fRecPoints;
new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
}
-//______________________________________________________________________
-void AliITSDetTypeRec::AddClusterV2(const AliITSclusterV2 &r){
- // Add a reconstructed space point to the list
- // Inputs:
- // const AliITSClusterV2 &r class to be added to the tree
- // of reconstructed points TreeR.
- // Outputs:
- // none.
- // Return:
- // none.
-
- TClonesArray &lrecp = *fClustersV2;
- new(lrecp[fNClustersV2++]) AliITSclusterV2(r);
- }
//______________________________________________________________________
void AliITSDetTypeRec::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt, Bool_t v2){
// be processed. If ="All" then all of the ITS
// sub detectors are processed.
- if(!fGeom){
- Warning("DigitsToRecPoints","fGeom is null!");
+ if(!GetITSgeom()){
+ Warning("DigitsToRecPoints","Null pointer to AliITSgeom !");
return;
}
if(!fLoader){
const char *all = strstr(opt,"All");
const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
strstr(opt,"SSD")};
- if(!v2) SetDefaultClusterFinders();
- else SetDefaultClusterFindersV2();
-
+ if(!v2) {
+ SetDefaultClusterFinders();
+ AliInfo("Original cluster finder has been selected\n");
+ }
+ else {
+ SetDefaultClusterFindersV2();
+ AliInfo("V2 cluster finder has been selected \n");
+ }
TTree *treeC=fLoader->TreeC();
if(!treeC){
}
AliITSClusterFinder *rec = 0;
Int_t id,module,first=0;
- for(module=0;module<fGeom->GetIndexMax();module++){
- id = fGeom->GetModuleType(module);
+ for(module=0;module<GetITSgeom()->GetIndexMax();module++){
+ id = GetITSgeom()->GetModuleType(module);
if (!all && !det[id]) continue;
- if(det[id]) first = fGeom->GetStartDet(id);
+ if(det[id]) first = GetITSgeom()->GetStartDet(id);
rec = (AliITSClusterFinder*)GetReconstructionModel(id);
TClonesArray *itsDigits = DigitsAddress(id);
if (!rec) {
} // end if
fLoader->TreeR()->Fill();
ResetRecPoints();
- ResetClustersV2();
treeC->Fill();
ResetClusters();
}
// none.
// Return:
// none.
- if(!fGeom){
- Warning("DigitsToRecPoints","fGeom is null!");
+ if(!GetITSgeom()){
+ Warning("DigitsToRecPoints","Null pointer to AliITSgeom !");
return;
}
if(!fLoader){
if(!fLoader->TreeR()) fLoader->MakeTree("R");
TTree* cTree = fLoader->TreeR();
- TClonesArray *array=new TClonesArray("AliITSclusterV2",1000);
- cTree->Branch("Clusters",&array);
+ TClonesArray *array=new TClonesArray("AliITSRecPoint",1000);
+ cTree->Branch("ITSRecPoints",&array);
delete array;
- TClonesArray** clusters = new TClonesArray*[fGeom->GetIndexMax()];
- for (Int_t iModule = 0; iModule < fGeom->GetIndexMax(); iModule++) {
+ TClonesArray** clusters = new TClonesArray*[GetITSgeom()->GetIndexMax()];
+ for (Int_t iModule = 0; iModule < GetITSgeom()->GetIndexMax(); iModule++) {
clusters[iModule] = NULL;
}
for(id=0;id<3;id++){
rec = (AliITSClusterFinderV2*)GetReconstructionModel(id);
rec->SetDetTypeRec(this);
- if (!rec) {
- Error("DigitsToRecPoints",
- "The reconstruction class was not instanciated");
- exit(1);
- }
+ if (!rec)
+ AliFatal("The reconstruction class was not instanciated");
+
rec->RawdataToClusters(rawReader,clusters);
}
Int_t nClusters =0;
- for(Int_t iModule=0;iModule<fGeom->GetIndexMax();iModule++){
+ TClonesArray *emptyArray=new TClonesArray("AliITSRecPoint");
+ for(Int_t iModule=0;iModule<GetITSgeom()->GetIndexMax();iModule++){
array = clusters[iModule];
if(!array){
- Error("DigitsToRecPoints","data for module %d missing!",iModule);
- array = new TClonesArray("AliITSclusterV2");
+ AliDebug(1,Form("data for module %d missing!",iModule));
+ array = emptyArray;
}
- cTree->SetBranchAddress("Clusters",&array);
+ cTree->SetBranchAddress("ITSRecPoints",&array);
cTree->Fill();
nClusters+=array->GetEntriesFast();
- delete array;
}
+ delete emptyArray;
+
fLoader->WriteRecPoints("OVERWRITE");
delete[] clusters;
- Info("DigitsToRecPoints", "total number of found clustersV2 in ITS: %d\n",
+ Info("DigitsToRecPoints", "total number of found recpoints in ITS: %d\n",
nClusters);
}