]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Need to add a little more protection code and option to control the amount of warning...
authoraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Nov 2009 19:48:41 +0000 (19:48 +0000)
committeraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Nov 2009 19:48:41 +0000 (19:48 +0000)
HLT/MUON/OnlineAnalysis/AliHLTMUONHitReconstructorComponent.cxx
HLT/MUON/OnlineAnalysis/AliHLTMUONHitReconstructorComponent.h

index b7f39faf6659a34ce1d0f511d0e022fbdb075a58..d667d4daa7d5077353566eb35feb99d92e3e00ed 100644 (file)
@@ -78,7 +78,8 @@ AliHLTMUONHitReconstructorComponent::AliHLTMUONHitReconstructorComponent() :
        fIdToEntry(),
        fMaxEntryPerBusPatch(),
        fWarnForUnexpecedBlock(false),
-       fUseIdealGain(false)
+       fUseIdealGain(false),
+       fWarnIfPadSkipped(false)
 {
        ///
        /// Default constructor.
@@ -189,6 +190,7 @@ int AliHLTMUONHitReconstructorComponent::DoInit(int argc, const char** argv)
        fMaxEntryPerBusPatch.clear();
        fWarnForUnexpecedBlock = false;
        fUseIdealGain = false;
+       fWarnIfPadSkipped = false;
        const char* lutFileName = NULL;
        bool useCDB = false;
        typedef AliHLTMUONHitReconstructor HR;
@@ -399,6 +401,12 @@ int AliHLTMUONHitReconstructorComponent::DoInit(int argc, const char** argv)
                        makeChannels = true;
                        continue;
                }
+               
+               if (strcmp( argv[i], "-warnifpadskipped" ) == 0)
+               {
+                       fWarnIfPadSkipped = true;
+                       continue;
+               }
        
                HLTError("Unknown option '%s'", argv[i]);
                return -EINVAL;
@@ -1049,6 +1057,7 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
        
        AliMUONCalibrationData calibData(AliCDBManager::Instance()->GetRun());
        
+       bool skippedPads = false;
        Int_t chamberId;
        
        for(Int_t iCh = 6; iCh < 10; iCh++)
@@ -1082,7 +1091,7 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
                                Double_t realX, realY, realZ;
                                Double_t localX, localY, localZ;
                                Float_t calibA0Coeff,calibA1Coeff,pedestal,sigma;
-                               Int_t thresold,saturation;
+                               Float_t thresold,saturation;
                                
                                // Pad Info of a slat to print in lookuptable
                                for (Int_t iX = 0; iX<= maxIX ; iX++)
@@ -1107,7 +1116,8 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
                                        manuId = pad.GetLocation().GetFirst();
 #endif
                                        manuId &= 0x7FF; // 11 bits 
-                                       if(!calibData.Pedestals(detElemId, manuId)) continue;
+                                       if (calibData.Gains(detElemId, manuId) == NULL) continue;
+                                       if (calibData.Pedestals(detElemId, manuId) == NULL) continue;
                        
                                        buspatchId = ddlStore->GetBusPatchId(detElemId,manuId);
                                        
@@ -1156,8 +1166,8 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
                                        {
                                                calibA0Coeff = (calibData.Gains(detElemId, manuId))->ValueAsFloat(channelId, 0);
                                                calibA1Coeff = (calibData.Gains(detElemId, manuId))->ValueAsFloat(channelId, 1);
-                                               thresold = (calibData.Gains(detElemId, manuId))->ValueAsInt(channelId, 2);
-                                               saturation = (calibData.Gains(detElemId, manuId))->ValueAsInt(channelId, 4);
+                                               thresold = (calibData.Gains(detElemId, manuId))->ValueAsFloat(channelId, 2);
+                                               saturation = (calibData.Gains(detElemId, manuId))->ValueAsFloat(channelId, 4);
                                        }
                                        
                                        pedestal = (calibData.Pedestals(detElemId, manuId))->ValueAsFloat(channelId, 0);
@@ -1173,10 +1183,14 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
                                            sigma == AliMUONVCalibParam::InvalidFloatValue()
                                           )
                                        {
-                                               HLTWarning("Skipping pad on detection element %d, MANU %d, channel %d, since"
-                                                       " the calibration data contains invalid values in that channel.",
-                                                       detElemId, manuId, channelId
-                                               );
+                                               if (fWarnIfPadSkipped)
+                                               {
+                                                       HLTWarning("Skipping pad on detection element %d, MANU %d, channel %d, since"
+                                                               " the calibration data contains invalid values in that channel.",
+                                                               detElemId, manuId, channelId
+                                                       );
+                                               }
+                                               skippedPads = true;
                                                continue;
                                        }
                                        
@@ -1200,8 +1214,8 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
                                        lut.fSigma = sigma;
                                        lut.fA0 = calibA0Coeff;
                                        lut.fA1 = calibA1Coeff;
-                                       lut.fThres = thresold;
-                                       lut.fSat = saturation;
+                                       lut.fThres = Int_t(thresold);
+                                       lut.fSat = Int_t(saturation);
                                        
                                        HLTDebug("lut : detele : %d, id : %d, manu : %d, channel : %d, iX : %d, iY: %d, (X,Y) : (%f, %f), padsize : %f, plane : %d, ped : %f, sigma : %f",
                                                lut.fDetElemId,idManuChannel,manuId,channelId,lut.fIX,lut.fIY,lut.fRealX,lut.fRealY,lut.fHalfPadSize,lut.fPlane,lut.fPed,lut.fSigma
@@ -1213,6 +1227,14 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
                        } // iCath loop
                } // detElemId loop
        } // ichamber loop
+       
+       if (skippedPads and not fWarnIfPadSkipped)
+       {
+               HLTWarning("Skipped pads since they contained invalid calibration values."
+                       " Use the -warnifpadskipped argument to generate detailed information"
+                       " about which pads were skipped."
+               );
+       }
 
        try
        {
index 56ac211f046abbf62de0c2370d5c51cd53829de1..69da25c94aa959049929a93b7adf9074559cbc11 100644 (file)
@@ -111,6 +111,9 @@ extern "C" struct AliHLTMUONHitRecoLutRow;
  * \li -makechannels <br>
  *      This option will cause the component to generate extra channel information
  *      for each cluster found in the form of CHANNELS data blocks. <br>
+ * \li -warnifpadskipped <br>
+ *      If this option is set the a warning message is generated for every pad that
+ *      is skipped because it contains invalid value markers in the calibration data. <br>
  *
  * <h2>Standard configuration:</h2>
  * This component should normally be configured with either of the two sets of
@@ -209,6 +212,7 @@ private:
        MaxEntryPerBusPatch fMaxEntryPerBusPatch ;///< map to load maximum allowed buspatch entries for each buspatch
        bool fWarnForUnexpecedBlock;  ///< Flag indicating if we should log a warning if we got a block of an unexpected type.
        bool fUseIdealGain;  ///< Flag to indicate that ideal gain should be used and not loaded from the CDB.
+       bool fWarnIfPadSkipped;  ///< Flag for controlling if extensive warnings should be generated when skipping pads.
        
        ClassDef(AliHLTMUONHitReconstructorComponent, 0) // Hit reconstructor component for dHLT tracker DDL raw data.
 };