]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
updated the addition of objects in AliCaloCalibSignal::AddInfo
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 30 May 2008 14:05:45 +0000 (14:05 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 30 May 2008 14:05:45 +0000 (14:05 +0000)
EMCAL/AliCaloCalibSignal.cxx

index ab0a1b0d3676e134726c536df5e6453f0d6f15bc..4f5d1d2c950584d876081f4bf6e4e1cb058b81b2 100644 (file)
@@ -249,19 +249,47 @@ Bool_t AliCaloCalibSignal::AddInfo(const AliCaloCalibSignal *sig)
 {
   // just do this for the basic graphs/profiles that get filled in ProcessEvent
   // may not have data for all channels, but let's just Add everything..
+  // Note: this method will run into problems with TProfile adding if the binning of
+  // the local profiles is not the same as those provided by the argument *sig..
+  int numGraphPoints = 0;
+  int id = 0;
+  int ip = 0;
   for (int i = 0; i < fModules; i++) {
     for (int j = 0; j < fColumns; j++) {
       for (int k = 0; k < fRows; k++) {
        
-       int id = GetTowerNum(i,j,k);
-       if(fUseAverage){
-         GetProfAmpVsTimeHighGain(id)->Add(sig->GetProfAmpVsTimeHighGain(id));
-         GetProfAmpVsTimeLowGain(id)->Add(sig->GetProfAmpVsTimeLowGain(id));
+       id = GetTowerNum(i,j,k);
+
+       if(fUseAverage){ // add to Profiles
+         if (sig->GetProfAmpVsTimeHighGain(id)) {
+           GetProfAmpVsTimeHighGain(id)->Add(sig->GetProfAmpVsTimeHighGain(id));
+         }
+         if (sig->GetProfAmpVsTimeLowGain(id)) {
+           GetProfAmpVsTimeLowGain(id)->Add(sig->GetProfAmpVsTimeLowGain(id));
+         }
        }
-       else{     
-         //DS
-//       sig->GetGraphAmpVsTimeHighGain(i,j,k);
-//       sig->GetGraphAmpVsTimeLowGain(i,j,k);
+       else{ // add to Graphs    
+         // high gain
+         numGraphPoints= sig->GetGraphAmpVsTimeHighGain(id)->GetN();
+         if (numGraphPoints > 0) {
+           // get the values
+           double *graphX = sig->GetGraphAmpVsTimeHighGain(id)->GetX();
+           double *graphY = sig->GetGraphAmpVsTimeHighGain(id)->GetY();
+           for(ip=0; ip < numGraphPoints; ip++){
+             fGraphAmpVsTimeHighGain[id]->SetPoint(fNHighGain[id]++,graphX[ip],graphY[ip]);
+           }
+         }
+         // low gain
+         numGraphPoints= sig->GetGraphAmpVsTimeLowGain(id)->GetN();
+         if (numGraphPoints > 0) {
+           // get the values
+           double *graphX = sig->GetGraphAmpVsTimeLowGain(id)->GetX();
+           double *graphY = sig->GetGraphAmpVsTimeLowGain(id)->GetY();
+           for(ip=0; ip < numGraphPoints; ip++){
+             fGraphAmpVsTimeLowGain[id]->SetPoint(fNLowGain[id]++,graphX[ip],graphY[ip]);
+           }
+         }
+
        }
 
       }//end for nModules