]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
FILE_ID change for EMCAL DAs (to agree with Preprocessor expectations) + do check...
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 26 Sep 2009 19:27:11 +0000 (19:27 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 26 Sep 2009 19:27:11 +0000 (19:27 +0000)
EMCAL/AliCaloCalibSignal.cxx
EMCAL/AliCaloCalibSignal.h
EMCAL/EMCALLEDda.cxx
EMCAL/EMCALPEDda.cxx

index e83ee0c4d775aa6a81c7ba1577f507c23119f08a..f86365ea3fd7705f712e1f83cbf0b7ba5af98570 100644 (file)
@@ -65,8 +65,8 @@ AliCaloCalibSignal::AliCaloCalibSignal(kDetType detectorType) :
   fMapping(NULL),
   fRunNumber(-1),
   fStartTime(0),
-  fAmpCut(50),
-  fReqFractionAboveAmpCutVal(0.8),
+  fAmpCut(40), // min. 40 ADC counts as default
+  fReqFractionAboveAmpCutVal(0.6), // 60% in a strip, per default
   fReqFractionAboveAmp(kTRUE),
   fHour(0),
   fLatestHour(0),
@@ -221,7 +221,7 @@ void AliCaloCalibSignal::Zero()
   fNEvents = 0;
   fNAcceptedEvents = 0;
 
-  // Set the number of points for each tower: Amp vs. Time 
+  // Set the number of points for each tower: Amp vs. Time
   memset(fNHighGain, 0, sizeof(fNHighGain));
   memset(fNLowGain, 0, sizeof(fNLowGain));
   // and LED reference
@@ -231,28 +231,38 @@ void AliCaloCalibSignal::Zero()
 }
 
 //_____________________________________________________________________
-Bool_t AliCaloCalibSignal::CheckFractionAboveAmp(int *AmpVal, int nTotChan)
+Bool_t AliCaloCalibSignal::CheckFractionAboveAmp(int *AmpVal, 
+                                                int resultArray[])
 {
-  int nAbove = 0;
+  Bool_t returnCode = false;
     
   int TowerNum = 0;
+  double fraction = 0;
   for (int i = 0; i<fModules; i++) {
     for (int j = 0; j<fColumns; j++) {
+      int nAbove = 0;
       for (int k = 0; k<fRows; k++) {
        TowerNum = GetTowerNum(i,j,k);
        if (AmpVal[TowerNum] > fAmpCut) { 
          nAbove++;
        }
       }
+      resultArray[i*fColumns +j] = 0; // init. to denied
+      if (nAbove > 0) {
+       fraction = (1.0*nAbove) / fRows;
+       /*
+       printf("DS mod %d col %d nAbove %d fraction %3.2f\n",
+              i, j, nAbove, fraction);
+       */
+       if (fraction > fReqFractionAboveAmpCutVal) {
+         resultArray[i*fColumns + j] = nAbove;
+         returnCode = true;
+       }  
+      }
     }
-  }
-  
-  double fraction = (1.0*nAbove) / nTotChan;
+  } // modules loop
   
-  if (fraction > fReqFractionAboveAmpCutVal) {  
-    return true;
-  }
-  else return false;
+  return returnCode;
 }
 
 //_____________________________________________________________________
@@ -430,10 +440,17 @@ Bool_t AliCaloCalibSignal::ProcessEvent(AliCaloRawStreamV3 *in, AliRawEventHeade
   in->Reset(); // just in case the next customer forgets to check if the stream was reset..
 
   // now check if it was a led event, only use high gain (that should be sufficient)
+
+  // by default all columns are accepted (init check to > 0)
+  int checkResultArray[AliEMCALGeoParams::fgkEMCALModules * AliEMCALGeoParams::fgkEMCALCols];
+  for (int ia=0; ia<(AliEMCALGeoParams::fgkEMCALModules * AliEMCALGeoParams::fgkEMCALCols); ia++) { 
+    checkResultArray[ia] = 1; 
+  }
+
   if (fReqFractionAboveAmp) {
     bool ok = false;
     if (nHighChan > 0) { 
-      ok = CheckFractionAboveAmp(AmpValHighGain, nHighChan); 
+      ok = CheckFractionAboveAmp(AmpValHighGain, checkResultArray); 
     }
     if (!ok) return false; // skip event
   }
@@ -452,6 +469,7 @@ Bool_t AliCaloCalibSignal::ProcessEvent(AliCaloRawStreamV3 *in, AliRawEventHeade
   // it is a led event, now fill TTree
   for(int i=0; i<fModules; i++){
     for(int j=0; j<fColumns; j++){
+      if (checkResultArray[i*fColumns + j] > 0) { // column passed check 
       for(int k=0; k<fRows; k++){
        
        TowerNum = GetTowerNum(i, j, k); 
@@ -469,10 +487,20 @@ Bool_t AliCaloCalibSignal::ProcessEvent(AliCaloRawStreamV3 *in, AliRawEventHeade
          fNLowGain[TowerNum]++;
        }
       } // rows
+      } // column passed check
     } // columns
 
+    // We also do the activity check for LEDRefs/Strips, but need to translate between column
+    // and strip indices for that; based on these relations: 
+    // iStrip = AliEMCALGeoParams::GetStripModule(iSM, iCol);
+    // iStrip = (iSM%2==0) ? iCol/2 : AliEMCALGeoParams::fgkEMCALLEDRefs - 1 - iCol/2;
+    // which leads to
+    // iColFirst = (iSM%2==0) ? iStrip*2 : (AliEMCALGeoParams::fgkEMCALLEDRefs - 1 - iStrip)*2;
+
     // also LED refs
     for(int j=0; j<fLEDRefs; j++){
+      int iColFirst = (i%2==0) ? j*2 : (AliEMCALGeoParams::fgkEMCALLEDRefs - 1 - j)*2; //CHECKME!!!
+      if ( (checkResultArray[i*fColumns + iColFirst]>0) || (checkResultArray[i*fColumns + iColFirst + 1]>0) ) { // at least one column in strip passed check 
       for (gain=0; gain<2; gain++) {
        fRefNum = GetRefNum(i, j, gain); 
        if (LEDAmpVal[fRefNum]) {
@@ -480,7 +508,8 @@ Bool_t AliCaloCalibSignal::ProcessEvent(AliCaloRawStreamV3 *in, AliRawEventHeade
          fTreeLEDAmpVsTime->Fill();//fRefNum,fHour,fAmp);
          fNRef[fRefNum]++;
        }
-      }
+      } // gain
+      } // at least one column in strip passed check 
     }
 
   } // modules
index 8609af3e5ad91d268c3edef189bc27239a4eacd5..72eb53f82548bdcf430e290d808a5283c8580eab 100644 (file)
@@ -46,7 +46,7 @@ class AliCaloCalibSignal : public TObject {
   // Event processing methods:
   Bool_t ProcessEvent(AliRawReader *rawReader);
   Bool_t ProcessEvent(AliCaloRawStreamV3 *in, AliRawEventHeaderBase *aliHeader); // added header for time info
-  Bool_t CheckFractionAboveAmp(int *AmpVal, int nTotChan); // check fraction of signals to check for LED events
+  Bool_t CheckFractionAboveAmp(int *AmpVal, int resultArray[]); // check fraction of signals to check for LED events
 
   // Mapping handling
   AliCaloAltroMapping **GetAltroMapping() { return fMapping; };
index da4b168181d2e607ac4fb5431310957f67ac676a..7ef10f8524c1bc1ea03fbd916518fe669378b895 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 #define RESULT_FILE  "EMCALLED.root"
-#define FILE_ID "EMCALLED"
+#define FILE_ID "signal"
 #define AliDebugLevel() -1
 #define FILE_PEDClassName "emcCalibPedestal"
 #define FILE_SIGClassName "emcCalibSignal"
index e5abc033a6742dd99100c9755605259958e4ef21..97e185ec1282524192db048ad1f852e8e8f715dd 100644 (file)
@@ -22,7 +22,7 @@
 */
 
 #define RESULT_FILE  "EMCALPED.root"
-#define FILE_ID "EMCALPED"
+#define FILE_ID "pedestals"
 #define AliDebugLevel() -1
 #define FILE_PEDClassName "emcCalibPedestal"
 const int kNRCU = 4;