]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliCaloCalibPedestal.cxx
changed definition of AliHLTCaloClusterDataStruct from class to struct
[u/mrichter/AliRoot.git] / EMCAL / AliCaloCalibPedestal.cxx
index 118831276ae0785d5b349bd973c4add0b4f462ea..8d84dedf744bb3113e9cef9689d7fb52c6fa68bc 100644 (file)
@@ -254,10 +254,12 @@ void AliCaloCalibPedestal::CompressAndSetOwner()
 //_____________________________________________________________________
 AliCaloCalibPedestal::~AliCaloCalibPedestal()
 {
+  //dtor
+  
   if (fReference) delete fReference;//Delete the reference object, if it has been loaded
-
+  
   // delete also TObjArray's 
-  fPedestalLowGain.Delete();
+  fPedestalLowGain.Delete(); 
   fPedestalHighGain.Delete();
   fPedestalLEDRefLowGain.Delete();
   fPedestalLEDRefHighGain.Delete();
@@ -277,7 +279,7 @@ AliCaloCalibPedestal::~AliCaloCalibPedestal()
   fPeakMinusPedLowGainRatio.Delete();
   fPeakMinusPedHighGainRatio.Delete();
   fDeadMap.Delete();
-
+  
 }
 
 // copy ctor
@@ -433,7 +435,7 @@ void AliCaloCalibPedestal::SetParametersFromFile(const char *parameterFile)
       s >> keyValue;
       
       // check stream status
-      if( s.rdstate() & ios::failbit ) break;
+      if( ( s.rdstate() & ios::failbit ) == ios::failbit) break;
                        
       // skip rest of line if comments found
       if( keyValue.substr( 0, 2 ) == "//" ) break;
@@ -520,12 +522,32 @@ Bool_t AliCaloCalibPedestal::AddInfo(AliCaloCalibPedestal *ped)
   for (int i = 0; i < fModules; i++) {
     GetPedProfileLowGain(i)->Add( ped->GetPedProfileLowGain(i) );
     GetPedProfileHighGain(i)->Add( ped->GetPedProfileHighGain(i) );
+    GetPedLEDRefProfileLowGain(i)->Add( ped->GetPedLEDRefProfileLowGain(i) );
+    GetPedLEDRefProfileHighGain(i)->Add( ped->GetPedLEDRefProfileHighGain(i) );
     GetPeakProfileLowGain(i)->Add( ped->GetPeakProfileLowGain(i) );
     GetPeakProfileHighGain(i)->Add( ped->GetPeakProfileHighGain(i) );
     GetPeakHighGainHisto(i)->Add( ped->GetPeakHighGainHisto(i) );
 
   }//end for nModules 
 
+  // We should also copy other pieces of info: counters and parameters 
+  // (not number of columns and rows etc which should be the same)
+  // note that I just assign them here rather than Add them, but we
+  // normally just Add (e.g. in Preprocessor) one object so this should be fine.
+  fNEvents = ped->GetNEvents();
+  fNChanFills = ped->GetNChanFills();
+  fDeadTowers = ped->GetDeadTowerCount();
+  fNewDeadTowers = ped->GetDeadTowerNew();
+  fResurrectedTowers = ped->GetDeadTowerResurrected();
+  fRunNumber = ped->GetRunNumber();
+  fSelectPedestalSamples = ped->GetSelectPedestalSamples();
+  fFirstPedestalSample = ped->GetFirstPedestalSample();
+  fLastPedestalSample = ped->GetLastPedestalSample();
+  fDeadThreshold = ped->GetDeadThreshold();
+  fWarningThreshold = ped->GetWarningThreshold();
+  fWarningFraction = ped->GetWarningFraction();
+  fHotSigma = ped->GetHotSigma();
+
   // DeadMap; Diff profiles etc would need to be redone after this operation
 
   return kTRUE;//We succesfully added info from the supplied object
@@ -547,6 +569,8 @@ Bool_t AliCaloCalibPedestal::ProcessEvent(AliCaloRawStreamV3 *in)
 { 
   // Method to process=analyze one event in the data stream
   if (!in) return kFALSE; //Return right away if there's a null pointer
+  in->Reset(); // just in case the next customer forgets to check if the stream was reset..
+
   fNEvents++; // one more event
 
   if (fNEvents==1) ValidateProfiles(); // 1st event, make sure histos/profiles exist
@@ -650,7 +674,6 @@ Bool_t AliCaloCalibPedestal::ProcessEvent(AliCaloRawStreamV3 *in)
     }// end while over channel   
   }//end while over DDL's, of input stream 
 
-  in->Reset(); // just in case the next customer forgets to check if the stream was reset..
  
   return kTRUE;
 }
@@ -1064,7 +1087,7 @@ void AliCaloCalibPedestal::ComputeDeadTowers(const char * deadMapFile)
     }
     if (!diff->is_open()) {
       delete diff;
-      fout = 0;//Set the pointer to empty if the file was not opened
+      diff = 0;//Set the pointer to empty if the file was not opened
     }
   }