]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliCaloCalibSignal.cxx
correct mask for V0 charge decoding in STU payload
[u/mrichter/AliRoot.git] / EMCAL / AliCaloCalibSignal.cxx
index 83e812a7f173a6ab5126dfa629e66130d31b3fe7..b7142cee656641ffdab23c5c2408a797a6c87960 100644 (file)
@@ -133,47 +133,56 @@ void AliCaloCalibSignal::DeleteTrees()
 
 // copy ctor
 //_____________________________________________________________________
-AliCaloCalibSignal::AliCaloCalibSignal(const AliCaloCalibSignal &sig) :
-  TObject(sig),
-  fDetType(sig.GetDetectorType()),
-  fColumns(sig.GetColumns()),
-  fRows(sig.GetRows()),
-  fLEDRefs(sig.GetLEDRefs()),
-  fModules(sig.GetModules()),
-  fCaloString(sig.GetCaloString()),
-  fMapping(NULL), //! note that we are not copying the map info
-  fRunNumber(sig.GetRunNumber()),
-  fStartTime(sig.GetStartTime()),
-  fAmpCut(sig.GetAmpCut()),
-  fReqFractionAboveAmpCutVal(sig.GetReqFractionAboveAmpCutVal()),
-  fReqFractionAboveAmp(sig.GetReqFractionAboveAmp()),
-  fAmpCutLEDRef(sig.GetAmpCutLEDRef()),
-  fReqLEDRefAboveAmpCutVal(sig.GetReqLEDRefAboveAmpCutVal()),
-  fHour(sig.GetHour()),
-  fLatestHour(sig.GetLatestHour()),
-  fUseAverage(sig.GetUseAverage()),
-  fSecInAverage(sig.GetSecInAverage()),
-  fNEvents(sig.GetNEvents()),
-  fNAcceptedEvents(sig.GetNAcceptedEvents()),
-  fTreeAmpVsTime(NULL),
-  fTreeAvgAmpVsTime(NULL),
-  fTreeLEDAmpVsTime(NULL),
-  fTreeLEDAvgAmpVsTime(NULL)
-{
-  // also the TTree contents
-  AddInfo(&sig);
-}
-
+//AliCaloCalibSignal::AliCaloCalibSignal(const AliCaloCalibSignal &sig) :
+//  TObject(sig),
+//  fDetType(sig.GetDetectorType()),
+//  fColumns(sig.GetColumns()),
+//  fRows(sig.GetRows()),
+//  fLEDRefs(sig.GetLEDRefs()),
+//  fModules(sig.GetModules()),
+//  fCaloString(sig.GetCaloString()),
+//  fMapping(), //! note that we are not copying the map info
+//  fRunNumber(sig.GetRunNumber()),
+//  fStartTime(sig.GetStartTime()),
+//  fAmpCut(sig.GetAmpCut()),
+//  fReqFractionAboveAmpCutVal(sig.GetReqFractionAboveAmpCutVal()),
+//  fReqFractionAboveAmp(sig.GetReqFractionAboveAmp()),
+//  fAmpCutLEDRef(sig.GetAmpCutLEDRef()),
+//  fReqLEDRefAboveAmpCutVal(sig.GetReqLEDRefAboveAmpCutVal()),
+//  fHour(sig.GetHour()),
+//  fLatestHour(sig.GetLatestHour()),
+//  fUseAverage(sig.GetUseAverage()),
+//  fSecInAverage(sig.GetSecInAverage()),
+//  fNEvents(sig.GetNEvents()),
+//  fNAcceptedEvents(sig.GetNAcceptedEvents()),
+//  fTreeAmpVsTime(),
+//  fTreeAvgAmpVsTime(),
+//  fTreeLEDAmpVsTime(),
+//  fTreeLEDAvgAmpVsTime()
+//{
+//  // also the TTree contents
+//  AddInfo(&sig);
+//  for (Int_t i = 0; i<fgkMaxTowers; i++) {
+//      fNHighGain[i] = sig.fNHighGain[i];
+//      fNLowGain[i]  = sig.fNLowGain[i]; 
+//  }
+//  for (Int_t i = 0; i<(2*fgkMaxRefs); i++) {
+//    fNRef[i] = sig.fNRef[i]; 
+//  }
+//  
+//  
+//}
+//
 // assignment operator; use copy ctor to make life easy..
 //_____________________________________________________________________
-AliCaloCalibSignal& AliCaloCalibSignal::operator = (const AliCaloCalibSignal &source)
-{
-  // assignment operator; use copy ctor
-  if (&source == this) return *this;
-
-  new (this) AliCaloCalibSignal(source);
-  return *this;
-}
+//AliCaloCalibSignal& AliCaloCalibSignal::operator = (const AliCaloCalibSignal &source)
+//{
+//  // assignment operator; use copy ctor
+//  if (&source == this) return *this;
+//
+//  new (this) AliCaloCalibSignal(source);
+//  return *this;
+//}
 
 //_____________________________________________________________________
 void AliCaloCalibSignal::CreateTrees()
@@ -402,7 +411,7 @@ void AliCaloCalibSignal::WriteParametersToFile(const char *parameterFile)
 
 //_____________________________________________________________________
 Bool_t AliCaloCalibSignal::AddInfo(const AliCaloCalibSignal *sig)
-{
+{ 
   // note/FIXME: we are not yet adding correctly the info for fN{HighGain,LowGain,Ref} here - but consider this a feature for now (20080905): we'll do Analyze() unless entries were found for a tower in this original object.
 
   // add info from sig's TTrees to ours..
@@ -461,6 +470,23 @@ Bool_t AliCaloCalibSignal::AddInfo(const AliCaloCalibSignal *sig)
     fTreeLEDAvgAmpVsTime->Fill();
   }
 
+  // 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.
+  fRunNumber = sig->GetRunNumber();
+  fStartTime = sig->GetStartTime();
+  fAmpCut = sig->GetAmpCut();
+  fReqFractionAboveAmpCutVal = sig->GetReqFractionAboveAmpCutVal();
+  fReqFractionAboveAmp = sig->GetReqFractionAboveAmp();
+  fAmpCutLEDRef = sig->GetAmpCutLEDRef();
+  fReqLEDRefAboveAmpCutVal = sig->GetReqLEDRefAboveAmpCutVal();
+  fHour = sig->GetHour();
+  fLatestHour = sig->GetLatestHour();
+  fUseAverage = sig->GetUseAverage();
+  fSecInAverage = sig->GetSecInAverage();
+  fNEvents = sig->GetNEvents();
+  fNAcceptedEvents = sig->GetNAcceptedEvents();
 
   return kTRUE;//We hopefully succesfully added info from the supplied object
 }
@@ -724,8 +750,8 @@ Bool_t AliCaloCalibSignal::Analyze()
   //1: set up TProfiles for the towers that had data
   TProfile * profile[fgkMaxTowers*2]; // *2 is since we include both high and low gains
   memset(profile, 0, sizeof(profile));
-
-  char name[200]; // for profile id and title
+  const Int_t buffersize = 200;
+  char name[buffersize]; // for profile id and title
   int iTowerNum = 0;
 
   for (int i = 0; i<fModules; i++) {
@@ -736,14 +762,14 @@ Bool_t AliCaloCalibSignal::Analyze()
        // high gain
        if (fNHighGain[iTowerNum] > 0) {
          fChannelNum = GetChannelNum(i, ic, ir, 1); 
-         sprintf(name, "profileChan%d", fChannelNum);
+         snprintf(name,buffersize,"profileChan%d", fChannelNum);
          profile[fChannelNum] = new TProfile(name, name, numProfBins, timeMin, timeMax, "s");
        }
 
        // same for low gain
        if (fNLowGain[iTowerNum] > 0) {
          fChannelNum = GetChannelNum(i, ic, ir, 0); 
-         sprintf(name, "profileChan%d", fChannelNum);
+         snprintf(name,buffersize,"profileChan%d", fChannelNum);
          profile[fChannelNum] = new TProfile(name, name, numProfBins, timeMin, timeMax, "s");
        }
 
@@ -799,7 +825,7 @@ Bool_t AliCaloCalibSignal::Analyze()
       for (int gain=0; gain<2; gain++) {
        fRefNum = GetRefNum(i, j, gain);
        if (fNRef[fRefNum] > 0) { 
-         sprintf(name, "profileLEDRef%d", fRefNum);
+         snprintf(name, buffersize, "profileLEDRef%d", fRefNum);
          profileLED[fRefNum] = new TProfile(name, name, numProfBins, timeMin, timeMax, "s");
        } 
       }// gain