Protection against no valid abs pad number
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Jul 2008 10:52:45 +0000 (10:52 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Jul 2008 10:52:45 +0000 (10:52 +0000)
HMPID/AliHMPIDPreprocessor.cxx
HMPID/AliHMPIDRawStream.cxx
HMPID/AliHMPIDRawStream.h

index da38a9c..3a3d33a 100644 (file)
@@ -193,9 +193,11 @@ Bool_t AliHMPIDPreprocessor::ProcPed()
     infile>>tName>>nSigCut; pM->SetUniqueID(nSigCut); //n. of pedestal distribution sigmas used to create zero suppresion table
     while(!infile.eof()){
       infile>>dec>>r>>d>>a>>mean>>sigma>>hex>>hard;
+      if(rs.GetPad(iddl,r,d,a)>=0){                    //the GetPad returns meaningful abs pad number                                                          
       dig.SetPad(rs.GetPad(iddl,r,d,a));
       dig.SetQ((Int_t)mean);
       (*pM)(dig.PadChX(),dig.PadChY()) = sigma;
+      }
     }
     infile.close();
     Log(Form("Pedestal file for DDL %i read successfully",iddl));
index dbab61a..1116eb4 100644 (file)
@@ -377,6 +377,7 @@ Bool_t AliHMPIDRawStream::ReadDilogic(Int_t &cntDilogic)
     UInt_t pad = (fWord >> kbit12) & 0x3f;                                          //pad info in raw word is between bits: 12...17
     if(!CheckPad(pad)) continue;
     Int_t charge = fWord & 0xfff;
+    if(GetPad(fDDLNumber,row,dilogic,pad)<0) continue;
     fPad[fNPads] = GetPad(fDDLNumber,row,dilogic,pad);
     fCharge[fNPads] = charge; 
     fNPads++;
index c3aef37..59d0388 100644 (file)
@@ -197,16 +197,14 @@ Int_t AliHMPIDRawStream::GetPad(Int_t ddl,Int_t row,Int_t dil,Int_t pad)
   // in case the charge from the channels
   // has not been read or invalid arguments
  
-  assert(0<=ddl&&ddl<=13);  
-  assert(1<=row&&row<=24); 
-  assert(1<=dil&&dil<=10);   
-  assert(0<=pad&&pad<=47);  
-  
+  //assert(0<=ddl&&ddl<=13);  assert(1<=row&&row<=24);   assert(1<=dil&&dil<=10);     assert(0<=pad&&pad<=47);  
+  /* clm */ //corrupted data from ddl aborts the pedestal run at the assert
+  if(ddl<0 || ddl >13 || row<1 || row >25 || dil<1 || dil >10 || pad<0 || pad >47 ) return -1;
+  /* clm */
   Int_t a2y[6]={3,2,4,1,5,0};     //pady for a given padress (for single DILOGIC chip)
   Int_t ch=ddl/2;
   Int_t tmp=(24-row)/8;
   Int_t pc=(ddl%2)?5-2*tmp:2*tmp;
-//  Int_t px=(dil-1)*8+pad/6;
   Int_t px=dil*8-pad/6-1;  //flip according to Paolo (26-3-2008)
 
   tmp=(ddl%2)?row-1:(24-row);