]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDCalibChamberStatus.cxx
Bug fix in chamber status (Julian)
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibChamberStatus.cxx
index 6a43d41ed0db5af69046d29d1cf5d5816d6b1e66..8f90aca69ea80c25c3e19c852242aa1578fb2429 100644 (file)
@@ -410,7 +410,7 @@ Bool_t AliTRDCalibChamberStatus::TestEventHisto(Int_t nevent) /*FOLD00*/
 
 }
 //_____________________________________________________________________
-void AliTRDCalibChamberStatus::AnalyseHisto(Int_t limit) /*FOLD00*/
+void AliTRDCalibChamberStatus::AnalyseHisto(Int_t limit, Double_t chamberlimit) /*FOLD00*/
 {
   //
   //  Create the AliTRDCalChamberStatus according to the fHnSparseI
@@ -419,6 +419,8 @@ void AliTRDCalibChamberStatus::AnalyseHisto(Int_t limit) /*FOLD00*/
   if(fCalChamberStatus) delete fCalChamberStatus;
   fCalChamberStatus = new AliTRDCalChamberStatus();
 
+  //printf("test0\n");
+
   // Check if enough events/tracklets per halfchamber to say something
   Double_t mean=0.0; //number of tracklets per HCS
   Int_t coord2[4];
@@ -426,8 +428,8 @@ void AliTRDCalibChamberStatus::AnalyseHisto(Int_t limit) /*FOLD00*/
     //if(fHnSparseI->GetBinContent(bin,coord2)==0.0) printf(" bin shouldnt be empty!!\n");
     mean+=fHnSparseI->GetBinContent(bin,coord2);
   }
-  mean/=fHnSparseI->GetNbins();
-  //printf(" mean tracklets per halfchamber %f \n",mean);
+  if(fHnSparseI->GetNbins() > 0.0) mean/=fHnSparseI->GetNbins();
+  //printf(" mean tracklets per halfchamber %.3e \n",mean);
   if((fCounterEventNotEmpty < limit) && (mean < limit)) {
     // Say all good
     for (Int_t idet=0; idet<540; idet++) {
@@ -436,6 +438,8 @@ void AliTRDCalibChamberStatus::AnalyseHisto(Int_t limit) /*FOLD00*/
     return;
   }
 
+  //printf("test1\n");
+
   // set all chambers to NoData
   for (Int_t idet=0; idet<540; idet++) {
     fCalChamberStatus->SetStatus(idet,AliTRDCalChamberStatus::kNoData);
@@ -446,10 +450,14 @@ void AliTRDCalibChamberStatus::AnalyseHisto(Int_t limit) /*FOLD00*/
   for(Int_t bin = 0; bin < fHnSparseI->GetNbins(); bin++) {
     
     Double_t content = fHnSparseI->GetBinContent(bin,coord);
-    // layer, stack, sector
+    
+               // layer, stack, sector
     Int_t detector = AliTRDgeometry::GetDetector(coord[1]-1,coord[2]-1,coord[0]-1);
-    //
-    //printf("Number of entries for detector %d: %f\n",detector,content);
+    
+               if(content<chamberlimit*mean) {
+                       //printf("Number of entries for detector %03d-%s: %.3e -> %.3f \n",detector,(coord[3]-1==0?"A":"B"),content,content/mean);                      
+                       continue;
+               }
     //
     // Check which halfchamber side corresponds to the bin number (0=A, 1=B)
     // Change the status accordingly