#include "AliITSDetTypeRec.h"
#include "AliITSDDLModuleMapSDD.h"
#include "AliITSRecPoint.h"
+#include "AliITSRecPointContainer.h"
#include "AliITSCalibrationSDD.h"
-#include "AliITSHLTforSDD.h"
+#include "AliITSMapSDD.h"
#include "AliITSCalibrationSSD.h"
#include "AliITSNoiseSSDv2.h"
#include "AliITSGainSSDv2.h"
#include "AliITSLoader.h"
class AliITSDriftSpeedArraySDD;
-class AliITSMapSDD;
+class AliITSCorrMapSDD;
class AliITSRecoParam;
const Int_t AliITSDetTypeRec::fgkNdettypes = 3;
fDDLMapSDD(0),
fRespSDD(0),
fAveGainSDD(0),
-fIsHLTmodeC(0),
fRecPoints(0),
fNRecPoints(0),
fFirstcall(kTRUE),
fDDLMapSDD(rec.fDDLMapSDD),
fRespSDD(rec.fRespSDD),
fAveGainSDD(rec.fAveGainSDD),
-fIsHLTmodeC(rec.fIsHLTmodeC),
fRecPoints(rec.fRecPoints),
fNRecPoints(rec.fNRecPoints),
fFirstcall(rec.fFirstcall),
AliCDBEntry *noisySPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDNoisy");
AliCDBEntry *deadSPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDDead");
- AliCDBEntry *pitCond = AliCDBManager::Instance()->Get("ITS/Calib/PITConditions");
+ AliCDBEntry *pitCond = AliCDBManager::Instance()->Get("TRIGGER/SPD/PITConditions");
if(!noisySPD || !deadSPD || !pitCond ){
AliFatal("SPD Calibration object retrieval failed! ");
return kFALSE;
AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD");
AliCDBEntry *drSpSDD = AliCDBManager::Instance()->Get("ITS/Calib/DriftSpeedSDD");
AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD");
- AliCDBEntry *hltforSDD = AliCDBManager::Instance()->Get("ITS/Calib/HLTforSDD");
// AliCDBEntry *mapASDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsAnodeSDD");
AliCDBEntry *mapTSDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsTimeSDD");
- if(!entrySDD || !entry2SDD || !drSpSDD || !ddlMapSDD || !hltforSDD || !mapTSDD ){
+ if(!entrySDD || !entry2SDD || !drSpSDD || !ddlMapSDD || !mapTSDD ){
AliFatal("SDD Calibration object retrieval failed! ");
return kFALSE;
}
if(!cacheStatus)ddlMapSDD->SetObject(NULL);
ddlMapSDD->SetOwner(kTRUE);
- AliITSHLTforSDD* hltsdd=(AliITSHLTforSDD*)hltforSDD->GetObject();
- if(!cacheStatus)hltforSDD->SetObject(NULL);
- hltforSDD->SetOwner(kTRUE);
-
// TObjArray *mapAn = (TObjArray *)mapASDD->GetObject();
// if(!cacheStatus)mapASDD->SetObject(NULL);
// mapASDD->SetOwner(kTRUE);
delete entrySDD;
delete entry2SDD;
//delete mapASDD;
- delete hltforSDD;
delete mapTSDD;
delete drSpSDD;
delete ddlMapSDD;
}
- if ((!pSDD)||(!calSDD) || (!drSp) || (!ddlsdd) || (!hltsdd) || (!mapT) ){
+ if ((!pSDD)||(!calSDD) || (!drSp) || (!ddlsdd) || (!mapT) ){
AliWarning("Can not get SDD calibration from calibration database !");
return kFALSE;
}
fDDLMapSDD=ddlsdd;
fRespSDD=pSDD;
- fIsHLTmodeC=hltsdd->IsHLTmodeC();
AliITSCalibration* cal;
Float_t avegain=0.;
Float_t nGdAnodes=0;
+ Bool_t oldMapFormat=kFALSE;
+ TObject* objmap=(TObject*)mapT->At(0);
+ TString cname(objmap->ClassName());
+ if(cname.CompareTo("AliITSMapSDD")==0){
+ oldMapFormat=kTRUE;
+ AliInfo("SDD Maps converted to new format");
+ }
for(Int_t iddl=0; iddl<AliITSDDLModuleMapSDD::GetNDDLs(); iddl++){
for(Int_t icar=0; icar<AliITSDDLModuleMapSDD::GetNModPerDDL();icar++){
Int_t iMod=fDDLMapSDD->GetModuleNumber(iddl,icar);
nGdAnodes++;
}
AliITSDriftSpeedArraySDD* arr0 = (AliITSDriftSpeedArraySDD*) drSp->At(i0);
- // AliITSMapSDD* ma0 = (AliITSMapSDD*)mapAn->At(i0);
- AliITSMapSDD* mt0 = (AliITSMapSDD*)mapT->At(i0);
AliITSDriftSpeedArraySDD* arr1 = (AliITSDriftSpeedArraySDD*) drSp->At(i1);
- // AliITSMapSDD* ma1 = (AliITSMapSDD*)mapAn->At(i1);
- AliITSMapSDD* mt1 = (AliITSMapSDD*)mapT->At(i1);
+
+ AliITSCorrMapSDD* mt0 = 0;
+ AliITSCorrMapSDD* mt1 = 0;
+ if(oldMapFormat){
+ AliITSMapSDD* oldmap0=(AliITSMapSDD*)mapT->At(i0);
+ AliITSMapSDD* oldmap1=(AliITSMapSDD*)mapT->At(i1);
+ mt0=oldmap0->ConvertToNewFormat();
+ mt1=oldmap1->ConvertToNewFormat();
+ }else{
+ mt0=(AliITSCorrMapSDD*)mapT->At(i0);
+ mt1=(AliITSCorrMapSDD*)mapT->At(i1);
+ }
cal->SetDriftSpeed(0,arr0);
cal->SetDriftSpeed(1,arr1);
-// cal->SetMapA(0,ma0);
-// cal->SetMapA(1,ma1);
cal->SetMapT(0,mt0);
cal->SetMapT(1,mt1);
SetCalibrationModel(iMod, cal);
return kFALSE;
}
- TObject *emptyssd = 0; TString ssdobjectname = 0;
+ TObject *emptyssd = 0; TString ssdobjectname;
AliITSNoiseSSDv2 *noiseSSD = new AliITSNoiseSSDv2();
emptyssd = (TObject *)entryNoiseSSD->GetObject();
ssdobjectname = emptyssd->GetName();
strstr(opt,"SSD")};
if(optCluFind==0){
SetDefaultClusterFindersV2();
- AliInfo("V2 cluster finder has been selected \n");
+ AliDebug(1,"V2 cluster finder has been selected \n");
}else{
SetDefaultClusterFindersV2();
AliInfo("Cluster Finder Option not implemented, V2 cluster finder will be used \n");
if (!itsLoader) {
AliError("ITS loader is NULL.");
}
- else {
- AliBaseLoader* foLoader = itsLoader->GetFOSignalsLoader();
- if (!foLoader) {
- AliError("FO signals base loader not retrieved.");
- }
- else {
- foLoader->Load();
- fFOSignals = (AliITSFOSignalsSPD*) foLoader->Get();
- }
- }
+ else {
+ fFOSignals = (AliITSFOSignalsSPD*)itsLoader->TreeD()->GetUserInfo()->FindObject("AliITSFOSignalsSPD");
+ if(!fFOSignals) AliError("FO signals not retrieved");
+ }
+
}
// Remove PIT in-active chips from Fast-OR fired map
if (all || det[0]) { // SPD present
RemoveFastOrFiredInActive();
+ // here removing bits which have no associated clusters
+ RemoveFastOrFiredFromDead(GetFiredChipMap(treeR));
}
}
//______________________________________________________________________
const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
strstr(opt,"SSD")};
- // Reset Fast-OR fired map
- ResetFastOrFiredMap();
-
- AliITSClusterFinder *rec = 0;
Int_t id=0;
TClonesArray *array=new TClonesArray("AliITSRecPoint",1000);
for (Int_t iModule = 0; iModule < GetITSgeom()->GetIndexMax(); iModule++) {
clusters[iModule] = NULL;
}
- for(id=0;id<3;id++){
- if (!all && !det[id]) continue;
- rec = (AliITSClusterFinder*)GetReconstructionModel(id);
- if (!rec)
- AliFatal("The reconstruction class was not instantiated");
- rec->SetDetTypeRec(this);
- rec->RawdataToClusters(rawReader,clusters);
- }
+
+ DigitsToRecPoints(rawReader,clusters,opt);
+
Int_t nClusters =0;
TClonesArray *emptyArray=new TClonesArray("AliITSRecPoint");
for(Int_t iModule=0;iModule<GetITSgeom()->GetIndexMax();iModule++){
Info("DigitsToRecPoints", "total number of found recpoints in ITS: %d\n",
nClusters);
+}
+//______________________________________________________________________
+void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader,TClonesArray** clusters,Option_t *opt){
+ // cluster finding and reconstruction of space points
+ // the condition below will disappear when the geom class will be
+ // initialized for all versions - for the moment it is only for v5 !
+ // 7 is the SDD beam test version
+ // Inputs:
+ // AliRawReader *rawReader Pointer to the raw-data reader
+ // TClonesArray **clusters Clusters Array
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+ const char *all = strstr(opt,"All");
+ const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
+ strstr(opt,"SSD")};
+
+ // Reset Fast-OR fired map
+ ResetFastOrFiredMap();
+
+ AliITSClusterFinder *rec = 0;
+ Int_t id=0;
+
+ for(id=0;id<3;id++){
+ if (!all && !det[id]) continue;
+ rec = (AliITSClusterFinder*)GetReconstructionModel(id);
+ if (!rec)
+ AliFatal("The reconstruction class was not instantiated");
+ rec->SetDetTypeRec(this);
+ rec->RawdataToClusters(rawReader,clusters);
+ }
+
// Remove PIT in-active chips from Fast-OR fired map
if (all || det[0]) { // SPD present
RemoveFastOrFiredInActive();
+ // here removing bits which have no associated clusters
+ if(clusters) RemoveFastOrFiredFromDead(GetFiredChipMap(clusters));
+
}
}
-
//______________________________________________________________________
void AliITSDetTypeRec::ReadOldSSDNoise(const TObjArray *array,
AliITSNoiseSSDv2 *noiseSSD) {
//______________________________________________________________________
void AliITSDetTypeRec::RemoveFastOrFiredInActive() {
// Removes the chips that were in-active in the pixel trigger (from fast-or fired map)
+
if (fTriggerConditions==NULL) {
AliError("Pixel trigger conditions are missing.");
return;
}
}
//______________________________________________________________________
+TBits AliITSDetTypeRec::GetFiredChipMap(TClonesArray **clusters) const {
+
+ //
+ // TBits of the fired chips
+ //
+
+ TBits isfiredchip(1200);
+
+ AliITSsegmentationSPD *segSPD = (AliITSsegmentationSPD*)GetSegmentationModel(0);
+ if(!segSPD) {
+ AliError("no segmentation model for SPD available, the fired chip map is empty. Exiting");
+ return isfiredchip;
+ }
+
+
+ for(Int_t imod =0; imod < fgkDefaultNModulesSPD; imod++){
+ TClonesArray *array = clusters[imod];
+ if(!array) continue;
+ Int_t nCluster = array->GetEntriesFast();
+
+ while(nCluster--) {
+ AliITSRecPoint* cluster = (AliITSRecPoint*)array->UncheckedAt(nCluster);
+ if (cluster->GetLayer()>1)continue;
+ Float_t local[3]={-1,-1};
+ local[1]=cluster->GetDetLocalX();
+ local[0]=cluster->GetDetLocalZ();
+
+ Int_t eq = AliITSRawStreamSPD::GetOnlineEqIdFromOffline(imod);
+ Int_t hs = AliITSRawStreamSPD::GetOnlineHSFromOffline(imod);
+ Int_t row, col;
+ segSPD->LocalToDet(0.5,local[0],row,col);
+ Int_t chip = AliITSRawStreamSPD::GetOnlineChipFromOffline(imod,col);
+ Int_t chipkey = AliITSRawStreamSPD::GetOfflineChipKeyFromOnline(eq,hs,chip);
+ isfiredchip.SetBitNumber(chipkey,kTRUE);
+ }
+
+ }
+
+ return isfiredchip;
+
+}
+//______________________________________________________________________
+TBits AliITSDetTypeRec::GetFiredChipMap(TTree *treeR) const{
+ //
+ // TBits of the fired chips
+ //
+ TBits isfiredchip(1200);
+
+ if(!treeR) {
+ AliError("no treeR. fired chip map stays empty. Exiting.");
+ return isfiredchip;
+ }
+
+ AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
+ TClonesArray *recpoints = rpcont->FetchClusters(0,treeR);
+ if(!rpcont->GetStatusOK() || !rpcont->IsSPDActive()){
+ AliError("no clusters. fired chip map stays empty. Exiting.");
+ return isfiredchip;
+ }
+
+ AliITSsegmentationSPD *segSPD = (AliITSsegmentationSPD*)GetSegmentationModel(0);
+
+ for(Int_t imod =0; imod < fgkDefaultNModulesSPD; imod++){
+ recpoints = rpcont->UncheckedGetClusters(imod);
+ Int_t nCluster = recpoints->GetEntriesFast();
+
+ // loop over clusters
+ while(nCluster--) {
+ AliITSRecPoint* cluster = (AliITSRecPoint*)recpoints->UncheckedAt(nCluster);
+ if (cluster->GetLayer()>1)continue;
+ Float_t local[3]={-1,-1};
+ local[1]=cluster->GetDetLocalX();
+ local[0]=cluster->GetDetLocalZ();
+
+ Int_t eq = AliITSRawStreamSPD::GetOnlineEqIdFromOffline(imod);
+ Int_t hs = AliITSRawStreamSPD::GetOnlineHSFromOffline(imod);
+ Int_t row, col;
+ segSPD->LocalToDet(0.5,local[0],row,col);
+ Int_t chip = AliITSRawStreamSPD::GetOnlineChipFromOffline(imod,col);
+ Int_t chipkey = AliITSRawStreamSPD::GetOfflineChipKeyFromOnline(eq,hs,chip);
+ isfiredchip.SetBitNumber(chipkey,kTRUE);
+ }
+ }
+
+ return isfiredchip;
+}
+//______________________________________________________________________
+void AliITSDetTypeRec::RemoveFastOrFiredFromDead(TBits firedchipmap){
+ //
+ // resetting of the fast-or bit on cluster basis.
+ // fast-or bits can be remnant from SPD ideal simulation (no dead channels)
+ //
+
+ for(Int_t chipKey=0; chipKey<1200; chipKey++){
+ // FO masked chips have been previously removed
+ if(!fFastOrFiredMap.TestBitNumber(chipKey)) continue;
+ if(!firedchipmap.TestBitNumber(chipKey)) {
+ fFastOrFiredMap.SetBitNumber(chipKey,kFALSE);
+ AliDebug(2,Form("removing bit in key %i \n ",chipKey));
+ }
+ }
+
+}
+//______________________________________________________________________
void AliITSDetTypeRec::SetFastOrFiredMapOnline(UInt_t eq, UInt_t hs, UInt_t chip) {
// Set fast-or fired map for this chip
Int_t chipKey = AliITSRawStreamSPD::GetOfflineChipKeyFromOnline(eq,hs,chip);
return SetFastOrFiredMap(chipKey);
}
-