]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
mods for not having remnant FO bits if SPD simulation is ideal ( = without dead pixel...
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 10 Jan 2010 18:26:38 +0000 (18:26 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 10 Jan 2010 18:26:38 +0000 (18:26 +0000)
ITS/AliITSDetTypeRec.cxx
ITS/AliITSDetTypeRec.h

index f29718f1de008a4eb40f78c61266c0d92fec894e..c92d970a1f2fd64399d070d9228560bf337f6531 100644 (file)
@@ -34,6 +34,7 @@
 #include "AliITSDetTypeRec.h"
 #include "AliITSDDLModuleMapSDD.h"
 #include "AliITSRecPoint.h"
+#include "AliITSRecPointContainer.h"
 #include "AliITSCalibrationSDD.h"
 #include "AliITSMapSDD.h"
 #include "AliITSCalibrationSSD.h"
@@ -894,6 +895,8 @@ void AliITSDetTypeRec::DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastent
    // 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));  
   }
 }
 //______________________________________________________________________
@@ -987,6 +990,9 @@ void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader,TClonesArray**
   // 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));
+   
   }  
 }
 //______________________________________________________________________
@@ -1063,6 +1069,7 @@ void AliITSDetTypeRec::ReadOldSSDGain(const TObjArray *array,
 //______________________________________________________________________
 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;
@@ -1076,10 +1083,113 @@ void AliITSDetTypeRec::RemoveFastOrFiredInActive() {
   }
 }
 //______________________________________________________________________
+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);
 }
 
-
index 2ef7272c104985bb5dd1bba3e7e97c0b58b3d87b..a01dcd075952bf92905c1cac4244fe05ab7efb44 100644 (file)
@@ -32,6 +32,7 @@ class AliITSDDLModuleMapSDD;
 class AliITSNoiseSSDv2;
 class AliITSTriggerConditions;
 class AliITSFOSignalsSPD;
+class AliITSRecPointContainer;
 
 class AliITSDetTypeRec : public TObject {
   public:
@@ -98,9 +99,13 @@ class AliITSDetTypeRec : public TObject {
     void   SetFastOrFiredMapOnline(UInt_t eq, UInt_t hs, UInt_t chip);
     void   SetFastOrFiredMap(UInt_t chipKey){fFastOrFiredMap.SetBitNumber(chipKey);} 
     TBits  GetFastOrFiredMap() const {return fFastOrFiredMap;}
+    TBits  GetFiredChipMap(TClonesArray **clusters) const; // (using SPD RecPoints)
+    TBits  GetFiredChipMap(TTree *treeR) const; // (using SPD RecPoints)
     void   ResetFastOrFiredMap(){fFastOrFiredMap.ResetAllBits();}
     void   RemoveFastOrFiredInActive(); // (using Trigger Conditions)
+    void   RemoveFastOrFiredFromDead(TBits firedchipmap); // (using SPD RecPoints)
    
+    
   private:
     // private methods
     AliITSDetTypeRec(const AliITSDetTypeRec& rec);
@@ -149,3 +154,4 @@ class AliITSDetTypeRec : public TObject {
 };
 
 #endif
+