+ if (fTriggerConditions==NULL) {
+ AliError("Pixel trigger conditions are missing.");
+ return;
+ }
+ Int_t eq = -1;
+ Int_t hs = -1;
+ Int_t chip = -1;
+ while (fTriggerConditions->GetNextInActiveChip(eq,hs,chip)) {
+ UInt_t chipKey = AliITSRawStreamSPD::GetOfflineChipKeyFromOnline(eq,hs,chip);
+ fFastOrFiredMap.SetBitNumber(chipKey,kFALSE);
+ }
+}
+//______________________________________________________________________
+TBits AliITSDetTypeRec::GetFiredChipMap() const {
+
+ //
+ // TBits of the fired chips
+ //
+
+ AliITSRecPointContainer* rpc = AliITSRecPointContainer::Instance();
+
+ 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 = rpc->UncheckedGetClusters(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 = NULL;
+ 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);
+}